|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgroups.stack.LogicalAddress1_4
Logical address that spans the lifetime of a member. Assigned at member (JVM) startup, and
retained until member is shutdown. Note that the address does not change on
disconnect-connect sequences. For example, when a member is shunned and subsequently
readmitted to the group, the member's address (LogicalAddress1_4) remains the same.
An instance of LogicalAddress1_4 is generated by the transport protocol. Currently, only
UDP1_4 generates LogicalAddresses.
Note that host, timestamp and id are supposed to make LogicalAddress1_4 as unique as possible.
However, there is a remote chance that 2 instances started on the same machine create their
address at exactly the same time, resulting in identical addresses (leading to problems).
In the future, I will try to make this totally unique, by for example using the PID of the current
process (once available though the JDK, or by locking on a common resource (e.g. /dev/random)
to serialize creation. However, as for now, chances are you will never experience this problem.
Field Summary | |
protected static int |
count
|
protected java.lang.String |
host
|
protected int |
id
|
protected boolean |
multicast_addr
|
protected java.util.ArrayList |
physical_addrs
List |
protected long |
timestamp
|
Constructor Summary | |
LogicalAddress1_4()
|
|
LogicalAddress1_4(java.lang.String host_name,
java.util.List physical_addrs)
Use this constructor to create an instance, not the null-constructor |
Method Summary | |
void |
addPhysicalAddress(java.net.SocketAddress addr)
For internal use only ! Don't use this method ! |
java.lang.Object |
clone()
|
int |
compare(LogicalAddress1_4 other)
Establishes an order between 2 addresses. |
int |
compareTo(java.lang.Object o)
implements the java.lang.Comparable interface |
LogicalAddress1_4 |
copy()
|
boolean |
equals(java.lang.Object obj)
|
byte[] |
getAdditionalData()
Returns the additional_data. |
java.lang.String |
getHost()
|
long |
getId()
|
java.util.ArrayList |
getPhysicalAddresses()
Returns a copy of the list of physical addresses. |
java.net.SocketAddress |
getPrimaryPhysicalAddress()
|
long |
getTimestamp()
|
int |
hashCode()
|
protected void |
init(java.lang.String host_name,
java.util.List physical_addrs)
|
boolean |
isMulticastAddress()
Checks whether this is an address that represents multiple destinations, e.g. |
void |
readExternal(java.io.ObjectInput in)
|
void |
removeAllPhysicalAddresses()
For internal use only ! Don't use this method ! |
void |
removePhysicalAddress(java.net.SocketAddress addr)
For internal use only ! Don't use this method ! |
void |
setAdditionalData(byte[] additional_data)
Sets the additional_data. |
void |
setPrimaryPhysicalAddress(java.net.SocketAddress primary_physical_addr)
|
java.lang.String |
toString()
|
java.lang.String |
toString(boolean print_details)
|
void |
writeExternal(java.io.ObjectOutput out)
|
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static int count
protected java.lang.String host
protected long timestamp
protected int id
protected boolean multicast_addr
protected java.util.ArrayList physical_addrs
Constructor Detail |
public LogicalAddress1_4()
public LogicalAddress1_4(java.lang.String host_name, java.util.List physical_addrs)
Method Detail |
protected void init(java.lang.String host_name, java.util.List physical_addrs)
public java.lang.String getHost()
public long getTimestamp()
public long getId()
public java.net.SocketAddress getPrimaryPhysicalAddress()
public void setPrimaryPhysicalAddress(java.net.SocketAddress primary_physical_addr)
public java.util.ArrayList getPhysicalAddresses()
public void addPhysicalAddress(java.net.SocketAddress addr)
addr
- public void removePhysicalAddress(java.net.SocketAddress addr)
addr
- public void removeAllPhysicalAddresses()
public boolean isMulticastAddress()
Address
isMulticastAddress
in interface Address
public byte[] getAdditionalData()
public void setAdditionalData(byte[] additional_data)
additional_data
- The additional_data to setpublic int compare(LogicalAddress1_4 other)
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- - the Object to be compared
java.lang.ClassCastException
- - if the specified object's type prevents it
from being compared to this Object.Comparable
public boolean equals(java.lang.Object obj)
public int hashCode()
public java.lang.String toString()
public java.lang.String toString(boolean print_details)
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
public LogicalAddress1_4 copy()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |