|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ProtocolLoader
A protocol loader is an object that is responsible for loading protocols. The class ProtocolLoader is an interface. Given binary or source name of a protocol, a protocol loader will attempt to load the binary file or compile the corresponding source file into binary form and load it into the runtime environment.
Every protocol object contains a reference to the ProtocolLoader that loaded it. Although more convenient methods are provided through the ProtocolRegistry methods to find and load classes.
Care must be taken to link a loaded protocol definition at an appropriate time. This is typically done by the runtime environment when all the protocol's dependencies have been loaded first. Normally protocols are linked ondemand when they are needed by decoders and dissectors.
| Field Summary | |
|---|---|
static java.lang.String |
PROPERTY_JAVA_CLASS_PATH
|
static java.lang.String |
PROPERTY_NPL_PROTOCOL_PATH
|
| Method Summary | |
|---|---|
ProtocolInfo |
findLoadedProtocol(java.lang.String name)
Will search only in the list of protocols that have been already defined in the ProtocolRegistry. |
ProtocolInfo |
findProtocol(java.lang.String name)
Will search in the list of protocols that have been already defined in the ProtocolRegistry and in other places as defined by the implementation of this interface. |
ProtocolLoader |
getParent()
Returns the parent ProtocolLoader. |
java.net.URL |
getResource(java.lang.String name)
Method that returns a URL for the requested named resource. |
java.io.InputStream |
getResourceAsStream(java.lang.String name)
Opens up an InputStream to the resource if found. |
ProtocolInfo |
linkProtocol(java.lang.String name)
Links the named protocol into the runtime environment. |
ProtocolInfo |
loadProtocol(java.io.InputStream in,
java.net.URL url)
Loads a protocol definition from a user supplied stream. |
ProtocolInfo |
loadProtocol(java.lang.String name)
Loads either the binary protocol file or invokes the compiler to compile the source protocol definition to binary form and loads it. |
| Field Detail |
|---|
static final java.lang.String PROPERTY_NPL_PROTOCOL_PATH
static final java.lang.String PROPERTY_JAVA_CLASS_PATH
| Method Detail |
|---|
ProtocolInfo findLoadedProtocol(java.lang.String name)
Will search only in the list of protocols that have been already defined in the ProtocolRegistry. Will not perform an extensive search for the protocol.
name - name of the protocol to locate
ProtocolInfo loadProtocol(java.lang.String name)
throws ProtocolDeclarationException,
ProtocolNotFoundException,
java.io.IOException
name - name of the protocol to load
ProtocolDeclarationException - if the protocol binary or source files contain some kind of
delaration or syntax errors
ProtocolNotFoundException - if the protocol binary and source files can not be found
java.io.IOException - any problems with physically accessing the files
ProtocolInfo linkProtocol(java.lang.String name)
throws ProtocolNotFoundException,
ProtocolDeclarationException,
java.io.IOException,
ProtocolBindingException
name - name of the protocol to link
ProtocolBindingException - Any problems during the linking process. Uresolved references, etc..
ProtocolDeclarationException - if the protocol binary or source files contain some kind of
delaration or syntax errors
ProtocolNotFoundException - if the protocol binary and source files can not be found
java.io.IOException - any problems with physically accessing the filesProtocolLoader getParent()
java.net.URL getResource(java.lang.String name)
name - name of the resource (protocol declaration, image, or anything else to search for.)
java.io.InputStream getResourceAsStream(java.lang.String name)
name - name of the resource to open
ProtocolInfo loadProtocol(java.io.InputStream in,
java.net.URL url)
throws ProtocolDeclarationException
in - Input stream to read fromurl - url of the source of this stream
ProtocolDeclarationException - any syntax or declaration errors found in the definition
ProtocolInfo findProtocol(java.lang.String name)
throws ProtocolNotFoundException
Will search in the list of protocols that have been already defined in the ProtocolRegistry and in other places as defined by the implementation of this interface.
name - name of the protocol to locate
ProtocolNotFoundException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||