java.rmi.dgc

Class VMID

public final class VMID extends Object implements Serializable

An identifier that is unique accross the all virtual machines. This class is used by distributed garbage collector to identify the virtual machine of the client, but may also be used in various other cases, when such identifier is required. This class separately stores and transfers the host IP address, but will try to do its best also for the case if it failed to determine it. The alternative algorithms are used in {@link UID} that is part of this class. The VMID's, created on the same host, but in the two separately (parallely) running virtual machines are different.
Constructor Summary
VMID()
Create the new VMID.
Method Summary
booleanequals(Object obj)
Returns true if the passed parameter is also VMID and it is equal to this VMID.
inthashCode()
Get the hash code of this VMID.
static booleanisUnique()
Return true if it is possible to get the accurate address of this host.
StringtoString()
Get the string representation of this VMID.

Constructor Detail

VMID

public VMID()
Create the new VMID. All VMID's are unique accross tha all virtual machines.

Method Detail

equals

public boolean equals(Object obj)
Returns true if the passed parameter is also VMID and it is equal to this VMID. The VMID should only be equal to itself (also if the passed value is another instance, cloned by serialization).

hashCode

public int hashCode()
Get the hash code of this VMID.

isUnique

public static boolean isUnique()

Deprecated: VMID's are more or less always reliable.

Return true if it is possible to get the accurate address of this host. If false is returned, the created VMID's are less reliable, but the starting time and possibly the memory allocation are also taken into consideration in the incorporated UID. Hence the VMID's, created on the different virtual machines, still should be different.

Returns: false if the local host ip address is 127.0.0.1 or unknown, true otherwise.

toString

public String toString()
Get the string representation of this VMID.