Package org.jivesoftware.smack
Interface StanzaListener
-
- All Known Subinterfaces:
PacketListener
- All Known Implementing Classes:
Node.ItemDeleteTranslator
,Node.ItemEventTranslator
,Node.NodeConfigTranslator
,SmackFuture.InternalProcessStanzaSmackFuture
,SmackFuture.SimpleInternalProcessStanzaSmackFuture
public interface StanzaListener
Provides a mechanism to listen for packets that pass a specified filter. This allows event-style programming -- every time a new stanza is found, theprocessStanza(Stanza)
method will be called. This is the opposite approach to the functionality provided by aStanzaCollector
which lets you block while waiting for results.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
processStanza(Stanza packet)
Process the next stanza sent to this stanza listener.
-
-
-
Method Detail
-
processStanza
void processStanza(Stanza packet) throws SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException
Process the next stanza sent to this stanza listener.If this listener is synchronous, then a single thread is responsible for invoking all listeners, so it's very important that implementations of this method not block for any extended period of time.
- Parameters:
packet
- the stanza to process.- Throws:
SmackException.NotConnectedException
- if the XMPP connection is not connected.InterruptedException
- if the calling thread was interrupted.SmackException.NotLoggedInException
- if the XMPP connection is not authenticated.
-
-