next up previous contents
Next: Setting options Up: Channel Previous: Creating a channel   Contents


Channel 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 the org.javagroups.stack.protocols package. Note that only the base name has to be given, not the fully specified class name (UDP instead of org.javagroups.stack.protocols.UDP).

Each layer may have zero 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 protocol, thus configuring the protocol stack according to the channel creator.

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: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. Property UDP refers to a class org.javagroups.stack.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.

Note that all members in a group have to have the same protocol stack.


next up previous contents
Next: Setting options Up: Channel Previous: Creating a channel   Contents
Bela Ban 2002-11-16