|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.rmi.activation.ActivationID
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:
RemoteRef
instance), and
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:
Activatable.register
method
Activatable
constructor (that takes
three arguments and both registers and exports the object, and
Activatable.exportObject
method
that takes the activation descriptor, object and port as arguments;
this method both registers and exports the object.
Activatable
,
Serialized FormField Summary | |
private Activator |
activator
the object's activator |
private static String |
activatorClassName
|
private static long |
serialVersionUID
indicate compatibility with the Java 2 SDK v1.2 version of class |
private UID |
uid
the object's unique id |
Constructor Summary | |
ActivationID(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. |
Method Summary | |
Remote |
activate(boolean force)
Activate the object for this id. |
boolean |
equals(Object obj)
Compares two activation ids for content equality. |
int |
hashCode()
Returns a hashcode for the activation id. |
private void |
readObject(ObjectInputStream in)
readObject for custom serialization.
|
private void |
writeObject(ObjectOutputStream out)
writeObject for custom serialization.
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private transient Activator activator
private transient UID uid
private static final long serialVersionUID
private static String activatorClassName
Constructor Detail |
public ActivationID(Activator activator)
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.
activator
- reference to the activator responsible for
activating the objectMethod Detail |
public Remote activate(boolean force) throws ActivationException, UnknownObjectException, RemoteException
force
- if true, forces the activator to contact the group
when activating the object (instead of returning a cached reference);
if false, returning a cached value is acceptable.
ActivationException
- if activation fails
UnknownObjectException
- if the object is unknown
RemoteException
- if remote call failspublic int hashCode()
hashCode
in class Object
Hashtable
public boolean equals(Object obj)
equals
in class Object
obj
- the Object to compare with
Hashtable
private void writeObject(ObjectOutputStream out) throws IOException, ClassNotFoundException
writeObject
for custom serialization.
This method writes this object's serialized form for this class as follows:
The writeObject
method is invoked on
out
passing this object's unique identifier
(a UID
instance) as the argument.
Next, the getRefClass
method is invoked on the activator's
RemoteRef
instance to obtain its external ref
type name. Next, the writeUTF
method is
invoked on out
with the value returned by
getRefClass
, and then the
writeExternal
method is invoked on the
RemoteRef
instance passing out
as the argument.
IOException
ClassNotFoundException
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
readObject
for custom serialization.
This method reads this object's serialized form for this class as follows:
The readObject
method is invoked on
in
to read this object's unique identifier
(a UID
instance).
Next, the readUTF
method is invoked on
in
to read the external ref type name of the
RemoteRef
instance for this object's
activator. Next, the RemoteRef
instance is created of an implementation-specific class
corresponding to the external ref type name (returned by
readUTF
), and the readExternal
method is invoked on that RemoteRef
instance
to read the external form corresponding to the external
ref type name.
Note: If the external ref type name is
"UnicastRef"
, "UnicastServerRef"
,
"UnicastRef2"
, "UnicastServerRef2"
,
"ActivatableRef"
, or
"ActivatableServerRef"
, a corresponding
implementation-specific class must be found, and its
readExternal
method must read the serial data
for that external ref type name as specified to be written
in the serialData documentation for this class.
If the external ref type name is any other string (of non-zero
length), a ClassNotFoundException
will be thrown,
unless the implementation provides an implementation-specific
class corresponding to that external ref type name, in which
case the RemoteRef
will be an instance of
that implementation-specific class.
IOException
ClassNotFoundException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |