next up previous contents
Next: Message Up: Channel and related classes Previous: ChannelListener   Contents

Address

Each member of a group has an address, which uniquely identifies the member. The interface for such an address is Address, which requires concrete implementations to provide methods for comparison and sorting of addresses, and for determination whether the address is a multicast address. JavaGroups addresses have to implement the following interface:

  public interface Address extends Externalizable, Comparable, Cloneable {
      boolean  isMulticastAddress();
      int      compareTo(Object o) throws ClassCastException;
      boolean  equals(Object obj);
      int      hashCode();
      String   toString();
  }

Actual implementations of addresses are often generated by the bottommost protocol layer (e.g. UDP or TCP). This allows for all possible sorts of addresses to be used with JavaGroups, e.g. ATM.

In JChannel, it is the IP address of the host on which the stack is running and the port on which the stack is receiving incoming messages; it is represented by the concrete class org.javagroups.stack.IpAddress. Instances of this class are only used within the JChannel protocol stack; users of a channel see addresses (of any kind) only as Addresses. Since an address uniquely identifies a channel, and therefore a group member, it can be used to send messages to that group member, e.g. in Messages (see next section).


next up previous contents
Next: Message Up: Channel and related classes Previous: ChannelListener   Contents
Bela Ban 2002-11-16