java.rmi.server
Class ObjID

java.lang.Object
  extended by java.rmi.server.ObjID
All Implemented Interfaces:
Serializable

public final class ObjID
extends Object
implements Serializable

Represents the object identifier, unique for the host that generated it. The ObjID contains inside the integer object identifier that, if needed, may indicated that this is a reference to one of the well known objects on that host (registry, activator or dgc) and the UID that ensures uniqueness.

See Also:
Serialized Form

Field Summary
static int ACTIVATOR_ID
          Defines the ID of the activator.
static int DGC_ID
          Defines the ID of the distributed garbage collector.
static int REGISTRY_ID
          Defines the ID of the naming service.
 
Constructor Summary
ObjID()
          Create the new object id, unique for this host.
ObjID(int id)
          Create the new object id defining the well known remotely accessible object, present in this host.
 
Method Summary
 boolean equals(Object obj)
          Compare for equality.
 int hashCode()
          Get the hashcode.
static ObjID read(ObjectInput in)
          Read object id (as long), then the object UID.
 String toString()
          Get the string representation.
 void write(ObjectOutput out)
          Write object id as long, then the object UID.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

REGISTRY_ID

public static final int REGISTRY_ID
Defines the ID of the naming service.

See Also:
Constant Field Values

ACTIVATOR_ID

public static final int ACTIVATOR_ID
Defines the ID of the activator.

See Also:
Constant Field Values

DGC_ID

public static final int DGC_ID
Defines the ID of the distributed garbage collector.

See Also:
Constant Field Values
Constructor Detail

ObjID

public ObjID()
Create the new object id, unique for this host.


ObjID

public ObjID(int id)
Create the new object id defining the well known remotely accessible object, present in this host. The well - known objects are:

Parameters:
id - the well known object id, one of the above.
Method Detail

write

public void write(ObjectOutput out)
           throws IOException
Write object id as long, then the object UID.

Throws:
IOException

read

public static ObjID read(ObjectInput in)
                  throws IOException
Read object id (as long), then the object UID.

Throws:
IOException

hashCode

public int hashCode()
Get the hashcode.

Overrides:
hashCode in class Object
Returns:
the hash code for this Object
See Also:
Object.equals(Object), System.identityHashCode(Object)

equals

public boolean equals(Object obj)
Compare for equality.

Overrides:
equals in class Object
Parameters:
obj - the Object to compare to
Returns:
whether this Object is semantically equal to another
See Also:
Object.hashCode()

toString

public String toString()
Get the string representation.

Overrides:
toString in class Object
Returns:
the String representing this Object, which may be null
See Also:
Object.getClass(), Object.hashCode(), Class.getName(), Integer.toHexString(int)