org.jnetpcap.util
Class PcapPacketSupport

java.lang.Object
  extended by org.jnetpcap.util.PcapPacketSupport
All Implemented Interfaces:
PcapPacketHandler<java.lang.Object>

public class PcapPacketSupport
extends java.lang.Object
implements PcapPacketHandler<java.lang.Object>

A utility class that dispatches a PcapPacket to any number of listeners. The packet is simply forwarded to any listeners as is.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Constructor Summary
PcapPacketSupport()
           
 
Method Summary
<T> boolean
add(PcapPacketHandler<T> o, T user)
          Adds the.
 void fireNextPacket(PcapPacket packet)
          Fire next packet.
 void nextPacket(PcapPacket packet, java.lang.Object user)
          Next packet.
 boolean remove(PcapPacketHandler<?> o)
          Removes the.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PcapPacketSupport

public PcapPacketSupport()
Method Detail

add

public <T> boolean add(PcapPacketHandler<T> o,
                       T user)
Adds the.

Type Parameters:
T - the generic type
Parameters:
o - the o
user - the user
Returns:
true, if successful

remove

public boolean remove(PcapPacketHandler<?> o)
Removes the.

Parameters:
o - the o
Returns:
true, if successful

fireNextPacket

public void fireNextPacket(PcapPacket packet)
Fire next packet.

Parameters:
packet - the packet

nextPacket

public void nextPacket(PcapPacket packet,
                       java.lang.Object user)
Next packet.

Specified by:
nextPacket in interface PcapPacketHandler<java.lang.Object>
Parameters:
packet - the packet
user - the user
See Also:
PcapPacketHandler.nextPacket(org.jnetpcap.packet.PcapPacket, java.lang.Object)