Smack

org.jivesoftware.smack
Interface PacketListener

All Known Implementing Classes:
DeliveryReceiptManager, Node.ItemDeleteTranslator, Node.ItemEventTranslator, Node.NodeConfigTranslator

public interface PacketListener

Provides a mechanism to listen for packets that pass a specified filter. This allows event-style programming -- every time a new packet is found, the processPacket(Packet) method will be called. This is the opposite approach to the functionality provided by a PacketCollector which lets you block while waiting for results.

Author:
Matt Tucker
See Also:
Connection.addPacketListener(PacketListener, org.jivesoftware.smack.filter.PacketFilter)

Method Summary
 void processPacket(Packet packet)
          Process the next packet sent to this packet listener.
 

Method Detail

processPacket

void processPacket(Packet packet)
Process the next packet sent to this packet listener.

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 packet to process.

Smack

Copyright © 2003-2007 Jive Software.