java.rmi.activation
public class: ActivationID [javadoc |
source]
java.lang.Object
java.rmi.activation.ActivationID
All Implemented Interfaces:
java$io$Serializable
Activation makes use of special identifiers to denote remote
objects that can be activated over time. An activation identifier
(an instance of the class
ActivationID
) contains several
pieces of information needed for activating an object:
- a remote reference to the object's activator (a RemoteRef
instance), and
- a unique identifier (a UID
instance) for the object.
An activation identifier for an object can be obtained by registering
an object with the activation system. Registration is accomplished
in a few ways:
- via the
Activatable.register
method
- via the first
Activatable
constructor (that takes
three arguments and both registers and exports the object, and
- via the first
Activatable.exportObject
method
that takes the activation descriptor, object and port as arguments;
this method both registers and exports the object.
Constructor: |
public ActivationID(Activator activator) {
this.activator = activator;
}
The constructor for ActivationID takes a single
argument, activator, that specifies a remote reference to the
activator responsible for activating the object associated with
this identifier. An instance of ActivationID is globally
unique. Parameters:
activator - reference to the activator responsible for
activating the object
- since:
1.2 -
|
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from java.rmi.activation.ActivationID Detail: |
public Remote activate(boolean force) throws ActivationException, UnknownObjectException, RemoteException {
try {
MarshalledObject< ? extends Remote > mobj =
activator.activate(this, force);
return mobj.get();
} catch (RemoteException e) {
throw e;
} catch (IOException e) {
throw new UnmarshalException("activation failed", e);
} catch (ClassNotFoundException e) {
throw new UnmarshalException("activation failed", e);
}
}
Activate the object for this id. |
public boolean equals(Object obj) {
if (obj instanceof ActivationID) {
ActivationID id = (ActivationID) obj;
return (uid.equals(id.uid) && activator.equals(id.activator));
} else {
return false;
}
}
Compares two activation ids for content equality.
Returns true if both of the following conditions are true:
1) the unique identifiers equivalent (by content), and
2) the activator specified in each identifier
refers to the same remote object. |
public int hashCode() {
return uid.hashCode();
}
Returns a hashcode for the activation id. Two identifiers that
refer to the same remote object will have the same hash code. |