站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档

Java Remote Method Invocation: 9 - Garbage Collector Interfaces - JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档

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:

  • the conditions for uniqueness for objects of the class java.rmi.server.UID are satisfied, and
  • an address can be obtained for the host that is unique and constant for the lifetime of the UID object.
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-1998 Sun Microsystems, Inc. All Rights Reserved.