jgroup
Interface MemberId


public interface MemberId

Instances of this class uniquely identify a member object in a group.

A member identifier is composed by three parts:

When created, a Jgroup subsytem takes control over some UDP communication port. Given the UDP specification, it is impossible that two Jgroup subsystem share the same port in the same machine. In this way, it is possible to discover if a remote Jgroup subsystem has crashed and then recovered; in this case, in fact, their incarnation times differ (the more recent is greater than the older). When a member id is created, its IP address and its incarnation time are set equal to each member id created in that Java virtual machine. So, the identifiers of members hosted in the same Java virtual machine differs only for the member counter.

Member ids may be compared in the following ways:

Since:
Jgroup 0.9
Author:
Alberto Montresor

Method Summary
 java.net.InetAddress getAddress()
          Returns the IP address of the java virtual machine hosting this member.
 int getCounter()
          Returns an integer used to distinguish this particular member from other members of the same group hosted in the same Java virtual machine.
 boolean isNeighbour(MemberId id)
          Returns true if and only if this member id and the specified member id have the same IP address and the same incarnation time; i.e., if they are hosted in the same virtual machine.
 boolean isNewer(MemberId id)
          Returns true if and only if the IP addresses of this member id and the specified id are the same, and the incarnation time of the former is greater than the incarnation time of the latter; in other words, if the Java virtual machine hosting the specified member id has crashed and then recovered.
 

Method Detail

getAddress

public java.net.InetAddress getAddress()
Returns the IP address of the java virtual machine hosting this member.

getCounter

public int getCounter()
Returns an integer used to distinguish this particular member from other members of the same group hosted in the same Java virtual machine.

isNewer

public boolean isNewer(MemberId id)
Returns true if and only if the IP addresses of this member id and the specified id are the same, and the incarnation time of the former is greater than the incarnation time of the latter; in other words, if the Java virtual machine hosting the specified member id has crashed and then recovered.

isNeighbour

public boolean isNeighbour(MemberId id)
Returns true if and only if this member id and the specified member id have the same IP address and the same incarnation time; i.e., if they are hosted in the same virtual machine.