- All Known Subinterfaces:
- All Known Implementing Classes:
public interface StanzaListenerProvides a mechanism to listen for packets that pass a specified filter. This allows event-style programming -- every time a new stanza is found, the
processStanza(Stanza)method will be called. This is the opposite approach to the functionality provided by a
StanzaCollectorwhich lets you block while waiting for results.
Additionally you are able to intercept Packets that are going to be send and make modifications to them. You can register a PacketListener as interceptor by using
void processStanza(Stanza packet) throws SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInExceptionProcess 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.