net.sourceforge.jpcap.capture
Class PacketDispatcher

java.lang.Object
  extended bynet.sourceforge.jpcap.capture.PacketDispatcher
All Implemented Interfaces:
PacketDispatchCapable
Direct Known Subclasses:
PacketCaptureBase

public abstract class PacketDispatcher
extends java.lang.Object
implements PacketDispatchCapable

This class encapsulates a mechanism for dispatching network data and packets to a listener who has subscribed to such events.

Since this class doesn't contain an implementation for handling real network data, it is abstract.

This class is extended by packet capture systems which, although they may utilize different sources of packet data, share a common mechanism for dispatching the packets.


Constructor Summary
PacketDispatcher()
           
 
Method Summary
 void addPacketListener(PacketListener objListener)
          Register a packet object listener with this capture system.
 void addRawPacketListener(RawPacketListener rawListener)
          Register a raw packet listener with this capture system.
 void dispatchPacket(Packet packet)
          Dispatch a packet to all registered listeners.
 void dispatchRawPacket(RawPacket rawPacket)
          Dispatch a raw packet to all registered listeners.
 void removePacketListener(PacketListener objListener)
          Deregister a packet object listener from this capture system.
 void removeRawPacketListener(RawPacketListener rawListener)
          Deregister a raw packet listener from this capture system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PacketDispatcher

public PacketDispatcher()
Method Detail

addRawPacketListener

public void addRawPacketListener(RawPacketListener rawListener)
Register a raw packet listener with this capture system.

Specified by:
addRawPacketListener in interface PacketDispatchCapable
Parameters:
rawListener - the raw packet listener to add to the notification list.

removeRawPacketListener

public void removeRawPacketListener(RawPacketListener rawListener)
Deregister a raw packet listener from this capture system.

Specified by:
removeRawPacketListener in interface PacketDispatchCapable
Parameters:
rawListener - the raw packet listener to remove from the notification list.

addPacketListener

public void addPacketListener(PacketListener objListener)
Register a packet object listener with this capture system.

Specified by:
addPacketListener in interface PacketDispatchCapable
Parameters:
objListener - the packet listener to add to the notification list.

removePacketListener

public void removePacketListener(PacketListener objListener)
Deregister a packet object listener from this capture system.

Specified by:
removePacketListener in interface PacketDispatchCapable
Parameters:
objListener - the packet listener to remove from the notification list.

dispatchRawPacket

public void dispatchRawPacket(RawPacket rawPacket)
Dispatch a raw packet to all registered listeners.


dispatchPacket

public void dispatchPacket(Packet packet)
Dispatch a packet to all registered listeners.