JavaGroups.JavaStack
Class Configurator
java.lang.Object
|
+--JavaGroups.JavaStack.Configurator
- public class Configurator
- extends java.lang.Object
The task if this class is to setup and configure the protocol stack. A string describing
the desired setup, which is both the layering and the configuration of each layer, is
given to the configurator which creates and configures the protocol stack and returns
a reference to the top layer (Protocol).
Future functionality will include the capability to dynamically modify the layering
of the protocol stack and the properties of each layer.
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Configurator
public Configurator()
SetupProtocolStack
public Protocol SetupProtocolStack(java.lang.String configuration,
ProtocolStack st)
throws java.lang.Exception
- The configuration string has a number of entries, separated by a ':' (semi).
Each entry consists of the name of the protocol, followed by an optional configuration
of that protocol. The configuration is enclosed in parentheses, and contains entries
which are name/value pairs connected with an assignment sign (=) and separated by
a semicolon.
UDP(in_port=5555;out_port=4445):FRAG(frag_size=1024)
The first entry defines the bottommost layer, the string is parsed
left to right and the protocol stack constructed bottom up. Example: the string
"UDP(in_port=5555):FRAG(frag_size=32000):DEBUG" results is the following stack:
-----------------------
| DEBUG |
|-----------------------|
| FRAG frag_size=32000 |
|-----------------------|
| UDP in_port=32000 |
-----------------------
StartProtocolStack
public void StartProtocolStack(Protocol bottom_prot)
StopProtocolStack
public void StopProtocolStack(Protocol start_prot)
FindProtocol
public Protocol FindProtocol(Protocol prot_stack,
java.lang.String name)
main
public static void main(java.lang.String[] args)