jgroup.core
Interface MemberId

All Superinterfaces:
java.lang.Comparable<MemberId>, java.io.Externalizable, java.io.Serializable
All Known Implementing Classes:
MemberIdImpl

public interface MemberId
extends java.io.Externalizable, java.lang.Comparable<MemberId>

A class implementing this interface 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, their incarnation times differ (the more recent is greater than the older). When a MemberId 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, Hein Meling, Marcin Solarski

Method Summary
 java.lang.String getCanonicalHostName()
          Returns the canonical hostname associated with the JVM on which the member is running.
 EndPoint getEndPoint()
          Returns the EndPoint (IP, port) of the java virtual machine hosting this member.
 LocalId getLocalId()
          Returns a LocalId object used to distinguish this particular member from other members of the same group hosted in the same Java virtual machine.
 int getServerPort()
          Returns the server port associated with this member host.
 net.jini.jeri.Endpoint getTcpEndpoint()
          Returns the TcpEndpoint of this member.
 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.
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getEndPoint

EndPoint getEndPoint()
Returns the EndPoint (IP, port) of the java virtual machine hosting this member.


getTcpEndpoint

net.jini.jeri.Endpoint getTcpEndpoint()
Returns the TcpEndpoint of this member.


getLocalId

LocalId getLocalId()
Returns a LocalId object used to distinguish this particular member from other members of the same group hosted in the same Java virtual machine.


getCanonicalHostName

java.lang.String getCanonicalHostName()
Returns the canonical hostname associated with the JVM on which the member is running.


getServerPort

int getServerPort()
Returns the server port associated with this member host. The server port is computed deterministically, based on the the host port number and the member number.


isNewer

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

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.



Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.