org.jnetpcap.util
Class JPacketSupport

java.lang.Object
  extended by org.jnetpcap.util.JPacketSupport
All Implemented Interfaces:
JPacketHandler<java.lang.Object>

public class JPacketSupport
extends java.lang.Object
implements JPacketHandler<java.lang.Object>

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

Author:
Mark Bednarczyk, Sly Technologies, Inc.

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

Constructor Detail

JPacketSupport

public JPacketSupport()
Method Detail

add

public <T> boolean add(JPacketHandler<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(JPacketHandler<?> o)
Removes the.

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

fireNextPacket

public void fireNextPacket(JPacket packet)
Fire next packet.

Parameters:
packet - the packet

nextPacket

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

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