CONTENTS | PREV | NEXT | Java Remote Method Invocation |
The activation protocol makes use of activation 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:
An activation identifier for an object can be obtained by registering an object with the activation system. Registration is accomplished in a few ways (also noted above):
- via the
Activatable.register
method, or- via the first
Activatable
constructor (that takes three arguments and both registers and exports the object), or- via the first
Activatable.exportObject
method that takes the activation descriptor, object implementation, and port as arguments; this method both registers and exports the object.
package java.rmi.activation;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 activation identifier. An instance of ActivationID is globally unique.
public class ActivationID implements java.io.Serializable
{
public ActivationID(Activator activator);
public Remote activate(boolean force)
throws ActivationException, UnknownObjectException,
java.rmi.RemoteException;
public boolean equals(Object obj);
public int hashCode();
}The
activate
method activates the object associated with the activation identifier. If the force parameter is true, the activator considers any cached reference for the remote object as stale, thus forcing the activator to contact the group when activating the object. If force is false, then returning the cached value is acceptable. If activation fails, ActivationException is thrown. If the object identifier is not known to the activator, then the method throws UnknownObjectException. If the remote call to the activator fails, then RemoteException is thrown.The
equals
method implements content equality. It returns true if all fields are equivalent (either identical or equivalent according to each field'sObject.equals
semantics). If p1 and p2 are instances of the class ActivationID, thehashCode
method will return the same value ifp1.equals(p2)
returns true.