next up previous contents
Next: Dependency checking Up: Customizing the JChannel protocol Previous: Customizing the JChannel protocol

   
Properties

A property string consists of a number of properties separated by colons:

       "<prop1>(arg1=val1):<prop2>(arg1=val1;arg2=val2):<prop3>:<propn>"

Each property relates directly to a protocol layer, which is implemented as a Java class. When a protocol stack is to be created based on the above property string, the first property becomes the bottom-most layer, the second one will be placed on the first, etc: the stack is created from the bottom to the top, as the string is parsed from left to right. Each property has to be the name of a Java class that resides in directory ./JavaGroups/JavaStack/Protocols3.8. Note that only the base name has to be given, not the fully specified class name (UDP instead of JavaGroups.JavaStack.Protocols.UDP).

Each layer may have 0 or more arguments, which are specified as a list of name/value pairs in parentheses directly after the property. In the example above, the first protocol layer has 1 argument, the second 2, the third none. When a layer is created, these properties (if there are any) will be set in a layer by invoking the layer's SetProperties method3.9.

As an example the property string below instructs JavaGroups to create a JChannel with protocols UDP, PING, FD and GMS:

       "UDP(mcast_addr=228.10.9.8;mcast_port=5678):PING:FD(trace=true):GMS"

The UDP protocol layer is at the bottom of the stack, and it should use mcast address 228.10.9.8. and port 5678 rather than the default IP multicast address and port. The only other argument instructs FD to output debug information while executing. Property UDP refers to a class JavaGroups.JavaStack.Protocols.UDP, which is subsequently loaded and an instance of which is created as protocol layer. If any of these classes are not found, an exception will be thrown and the construction of the stack will be aborted.


next up previous contents
Next: Dependency checking Up: Customizing the JChannel protocol Previous: Customizing the JChannel protocol

1999-12-13