CONTENTS | PREV | NEXT Java Remote Method Invocation


9.5 The VMID Class

The class VMID provides a universally unique identifier among all Java virtual machines. A VMID contains a UID and a host address. A VMID can be used to identify client virtual machines.

package java.rmi.dgc;

public final class VMID implements java.io.Serializable {

	public VMID();

	public static boolean isUnique();
	public int hashCode();
	public boolean equals(Object obj);	
	public String toString();
}
The VMID default constructor creates a globally unique identifier among all Java virtual machines under the following conditions:

A VMID contains the host address of the machine on which it was created. Due to security restrictions, obtaining the true host address is not always possible (for example, the loopback host may be used under security-restricted conditions). The method isUnique can be called to determine if VMIDs generated in this virtual machine are, in fact, unique among all virtual machines. The method isUnique returns true if a valid host name can be determined (other than loopback host); otherwise it returns false.

The hashCode, equals and toString methods are defined for VMIDs. Two VMIDs are considered equal if they have the same contents.





CONTENTS | PREV | NEXT
Copyright © 1997-1999 Sun Microsystems, Inc. All Rights Reserved.