public static final class PktFactory.PktType extends Object
This class stores packet type information for use by the factory
when instantiating packets. This class is only of interest to the
user if the user is registering packet types programatically using
PktFactory.registerPacketType(com.neeve.pkt.PktFactory.PktType, boolean).
| Modifier and Type | Class and Description |
|---|---|
static interface |
PktFactory.PktType.EventHandler
The packet type event handler
The packet factory type object dispatches events to the user
via an instance of this interface.
|
| Modifier and Type | Method and Description |
|---|---|
static PktFactory.PktType |
create(int id,
String name,
String bodyClassName,
boolean shouldPool,
Properties props)
Create a new packet type object.
|
static PktFactory.PktType |
create(int id,
String name,
String bodyClassName,
boolean shouldPool,
UtlPool.Params poolParams,
Properties props)
Create a new packet type object.
|
PktFactory.PktType.EventHandler |
getEventHandler()
Set the installed packet type event handler.
|
boolean |
pooled()
Get whether this packet type is pooled
|
PktFactory.PktType.EventHandler |
setEventHandler(PktFactory.PktType.EventHandler eventHandler)
Set the packet type event handler
|
String |
toString() |
public static final PktFactory.PktType create(int id, String name, String bodyClassName, boolean shouldPool, Properties props)
id - Each packet type in the system is uniquely identified
using a packet id. This contains the unique identifier of the
packet type being created.name - A name used to describe the packet type. It is a
fatal error to specify a name already in use by another packet
type.bodyClassName - The name of the class to be instantiated
for the packet body when instantiating a packet of the specified
type.shouldPool - Indicates whether packets of this type should be
pooled. Pooled packets are passed through a recycler to avoid
garbage collection.props - A set of properties to be associated with the packet
type. Packet type properties are passed unchanged to the packet
constructor when creating packets of that type.IllegalArgumentException - Thrown in case any of the supplied
arguments are invalid.public static final PktFactory.PktType create(int id, String name, String bodyClassName, boolean shouldPool, UtlPool.Params poolParams, Properties props)
id - Each packet type in the system is uniquely identified
using a packet id. This contains the unique identifier of the
packet type being created.name - A name used to describe the packet type. It is a
fatal error to specify a name already in use by another packet
type.bodyClassName - The name of the class to be instantiated
for the packet body when instantiating a packet of the specified
type.shouldPool - Indicates whether packets of this type should be
pooled. Pooled packets are passed through a recycler to avoid
garbage collection.poolParams - pool parameters that serve as the default values
if shouldPool is true.props - A set of properties to be associated with the packet
type. Packet type properties are passed unchanged to the packet
constructor when creating packets of that type.IllegalArgumentException - Thrown in case any of the supplied
arguments are invalid.public final boolean pooled()
public final PktFactory.PktType.EventHandler setEventHandler(PktFactory.PktType.EventHandler eventHandler)
eventHandler - The event handler to install. This paranmeter
can be null.public final PktFactory.PktType.EventHandler getEventHandler()
Copyright © 2019 N5 Technologies, Inc. All Rights Reserved.