| CONTENTS | PREV | NEXT | Java Remote Method Invocation |
ObjID Class
The classObjIDis used to identify remote objects uniquely in a virtual machine over time. Each identifier contains an object number and an address space identifier that is unique with respect to a specific host. An object identifier is assigned to a remote object when it is exported.An
ObjIDconsists of an object number (along) and a unique identifier for the address space (aUID).
package java.rmi.server; public final class ObjID implements java.io.Serializable { public ObjID (); public ObjID (int num); public void write(ObjectOutput out) throws java.io.IOException; public static ObjID read(ObjectInput in) throws java.io.IOException; public int hashCode() public boolean equals(Object obj) public String toString() }The first form of theObjIDconstructor generates a unique object identifier. The second constructor generates well-known object identifiers (such as those used by the registry and the distributed garbage collector) and takes as an argument a well-known object number. A well-known object ID generated via this second constructor will not clash with any object IDs generated via the default constructor; to enforce this, the object number of theObjIDis set to the "well-known" number supplied in the constructor and allUIDfields are set to zero.The method
writemarshals the object ID's representation to an output stream.The method
readconstructs an object ID whose contents is read from the specified input stream.The method
hashCodereturns the object number as the hashcodeThe
equalsmethod returns true if obj is anObjIDwith the same contents.The
toStringmethod returns a string containing the object ID representation. The address space identifier is included in the string representation only if the object ID is from a non-local address space.
CONTENTS | PREV | NEXT
Copyright © 1997-1999 Sun Microsystems, Inc. All Rights Reserved.