java.rmi.server

Class ObjID

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, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Details

ACTIVATOR_ID

public static final int ACTIVATOR_ID
Defines the ID of the activator.
Field Value:
1

DGC_ID

public static final int DGC_ID
Defines the ID of the distributed garbage collector.
Field Value:
2

REGISTRY_ID

public static final int REGISTRY_ID
Defines the ID of the naming service.
Field Value:
0

Constructor Details

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:
  • REGISTRY_ID - RMI naming service.
  • ACTIVATOR_ID - activator
  • DGC_ID - distributed garbage collector (grants lease durations to keep the object before it is garbage collected.
Parameters:
id - the well known object id, one of the above.

Method Details

equals

public boolean equals(Object obj)
Compare for equality.
Overrides:
equals in interface Object

hashCode

public int hashCode()
Get the hashcode.
Overrides:
hashCode in interface Object

read

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

toString

public String toString()
Get the string representation.
Overrides:
toString in interface Object

write

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

ObjID.java -- Unique object id with respect to the given host. Copyright (c) 1996, 1997, 1998, 1999, 2004, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. GNU Classpath is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Classpath is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Classpath; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Linking this library statically or dynamically with other modules is making a combined work based on this library. Thus, the terms and conditions of the GNU General Public License cover the whole combination. As a special exception, the copyright holders of this library give you permission to link this library with independent modules to produce an executable, regardless of the license terms of these independent modules, and to copy and distribute the resulting executable under terms of your choice, provided that you also meet, for each linked independent module, the terms and conditions of the license of that module. An independent module is a module which is not derived from or based on this library. If you modify this library, you may extend this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version.