Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.rmi.dgc
Class VMID  view VMID download VMID.java

java.lang.Object
  extended byjava.rmi.dgc.VMID
All Implemented Interfaces:
java.io.Serializable

public final class VMID
extends java.lang.Object
implements java.io.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 java.rmi.server.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.


Field Summary
private  byte[] addr
          The IP address of the local host.
(package private) static boolean areWeUnique
          If true, the IP of this host can ve reliably determined.
(package private)  int hash
          The cached hash code.
(package private) static byte[] localAddr
          The IP address of the local host.
(package private) static long serialVersionUID
          Use SVUID for interoperability.
private  java.rmi.server.UID uid
          The UID of this VMID.
 
Constructor Summary
VMID()
          Create the new VMID.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Returns true if the passed parameter is also VMID and it is equal to this VMID.
 int hashCode()
          Get the hash code of this VMID.
static boolean isUnique()
          Deprecated. VMID's are more or less always reliable.
 java.lang.String toString()
          Get the string representation of this VMID.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
Use SVUID for interoperability.

See Also:
Constant Field Values

areWeUnique

static boolean areWeUnique
If true, the IP of this host can ve reliably determined.


localAddr

static byte[] localAddr
The IP address of the local host.


addr

private byte[] addr
The IP address of the local host.


hash

transient int hash
The cached hash code.


uid

private java.rmi.server.UID uid
The UID of this VMID.

Constructor Detail

VMID

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

Method Detail

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.


hashCode

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


equals

public boolean equals(java.lang.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).


toString

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