KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > MessagePacketListener


1 import org.jivesoftware.smack.PacketListener;
2 import org.jivesoftware.smack.packet.*;
3
4 /** Listener for messages.*/
5 public final class MessagePacketListener implements PacketListener{
6     public void processPacket(Packet packet){
7         Message m;
8         try{
9             m=(Message) packet;
10         }
11         catch (ClassCastException JavaDoc cce){
12             return;
13         }
14         (new IncomingMessageThread(m)).start();
15     }
16     
17 }
Popular Tags