|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jnetpcap.packet.JHeaderPool
public class JHeaderPool
A thread local pool of instances of headers. The header pool keeps track of instances of headers it allocates based on protocol and thread IDs. The class allows private pools and also provides a global singleton pool which can be referenced from anywhere.
| Constructor Summary | |
|---|---|
JHeaderPool()
|
|
| Method Summary | ||
|---|---|---|
static JHeaderPool |
getDefault()
Gets a default global instance of this header pool. |
|
|
getHeader(java.lang.Class<T> clazz,
int id)
Gets an instance of a header for the given ID type. |
|
JHeader |
getHeader(int id)
Gets an instance of a header for the given ID type. |
|
|
getHeader(JProtocol protocol)
Gets an instance of a header for the protocol constant. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JHeaderPool()
| Method Detail |
|---|
public JHeader getHeader(int id)
throws UnregisteredHeaderException
id - numerical ID of the protocol header as assigned by JRegistry
UnregisteredHeaderException - thrown if ID is invalidpublic <T extends JHeader> T getHeader(JProtocol protocol)
This method does not throw an exception since all core protocols are always registered and always accessible.
protocol - core protocol constant
public <T extends JHeader> T getHeader(java.lang.Class<T> clazz,
int id)
T - header class nameclazz - parameterized class name that the retrieved header instance will
be cast toid - numerical ID of the protocol header as assigned by JRegistry
UnregisteredHeaderException - thrown if ID is invalidpublic static JHeaderPool getDefault()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||