Java Platform 1.2

java.rmi.activation
Class ActivationDesc

java.lang.Object
  |
  +--java.rmi.activation.ActivationDesc

public final class ActivationDesc
extends Object
implements Serializable

An activation descriptor contains the information necessary to activate an object:

A descriptor registered with the activation system can be used to recreate/activate the object specified by the descriptor. The MarshalledObject in the object's descriptor is passed as the second argument to the remote object's constructor for object to use during reinitialization/activation.

Since:
JDK1.2
See Also:
Activatable, Serialized Form

Constructor Summary
ActivationDesc(ActivationGroupID groupID, String className, String location, MarshalledObject data)
          Constructs an object descriptor for an object whose class name is className that can be loaded from the code location and whose initialization information is data.
ActivationDesc(ActivationGroupID groupID, String className, String location, MarshalledObject data, boolean restart)
          Constructs an object descriptor for an object whose class name is className that can be loaded from the code location and whose initialization information is data.
ActivationDesc(String className, String location, MarshalledObject data)
          Constructs an object descriptor for an object whose class name is className, that can be loaded from the code location and whose initialization information is data.
ActivationDesc(String className, String location, MarshalledObject data, boolean restart)
          Constructs an object descriptor for an object whose class name is className, that can be loaded from the code location and whose initialization information is data.
 
Method Summary
 boolean equals(Object obj)
          Compares two activation descriptors for content equality.
 String getClassName()
          Returns the class name for the object specified by this descriptor.
 MarshalledObject getData()
          Returns a "marshalled object" containing intialization/activation data for the object specified by this descriptor.
 ActivationGroupID getGroupID()
          Returns the group identifier for the object specified by this descriptor.
 String getLocation()
          Returns the code location for the object specified by this descriptor.
 boolean getRestartMode()
          Returns the "restart" mode of the object associated with this activation descriptor.
 int hashCode()
          Return the same hashCode for similar ActivationDescs.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivationDesc

public ActivationDesc(String className,
                      String location,
                      MarshalledObject data)
               throws ActivationException
Constructs an object descriptor for an object whose class name is className, that can be loaded from the code location and whose initialization information is data. If this form of the constructor is used, the groupID defaults to the current id for ActivationGroup for this VM. All objects with the same ActivationGroupID are activated in the same VM. Objects specified by a descriptor created by this constructor will not restart automatically when the RMI activation daemon starts, but will be activated on demand (via a method call to the activatable object).

This constructor will throw ActivationException if there is no current activation group for this VM. To create an ActivationGroup use the ActivationGroup.createGroup method.

Parameters:
className - the object's fully package qualified class name
location - the object's code location (from where the class is loaded)
data - the object's initialization (activation) data contained in marshalled form.
Throws:
ActivationException - if the current group is nonexistent
Since:
JDK1.2

ActivationDesc

public ActivationDesc(String className,
                      String location,
                      MarshalledObject data,
                      boolean restart)
               throws ActivationException
Constructs an object descriptor for an object whose class name is className, that can be loaded from the code location and whose initialization information is data. If this form of the constructor is used, the groupID defaults to the current id for ActivationGroup for this VM. All objects with the same ActivationGroupID are activated in the same VM.

This constructor will throw ActivationException if there is no current activation group for this VM. To create an ActivationGroup use the ActivationGroup.createGroup method.

Parameters:
className - the object's fully package qualified class name
location - the object's code location (from where the class is loaded)
data - the object's initialization (activation) data contained in marshalled form.
restart - if true, the object is restarted when the activator is restarted; if false, the object is activated on demand.
Throws:
ActivationException - if the current group is nonexistent
Since:
JDK1.2

ActivationDesc

public ActivationDesc(ActivationGroupID groupID,
                      String className,
                      String location,
                      MarshalledObject data)
Constructs an object descriptor for an object whose class name is className that can be loaded from the code location and whose initialization information is data. All objects with the same groupID are activated in the same Java VM.
Parameters:
groupID - the group's identifier (obtained from registering ActivationSystem.registerGroup method). The group indicates the VM in which the object should be activated.
className - the object's fully package-qualified class name
location - the object's code location (from where the class is loaded)
data - the object's initialization (activation) data contained in marshalled form.
Throws:
IllegalArgumentException - if groupID is null
Since:
JDK1.2

ActivationDesc

public ActivationDesc(ActivationGroupID groupID,
                      String className,
                      String location,
                      MarshalledObject data,
                      boolean restart)
Constructs an object descriptor for an object whose class name is className that can be loaded from the code location and whose initialization information is data. All objects with the same groupID are activated in the same Java VM.
Parameters:
groupID - the group's identifier (obtained from registering ActivationSystem.registerGroup method). The group indicates the VM in which the object should be activated.
className - the object's fully package-qualified class name
location - the object's code location (from where the class is loaded)
data - the object's initialization (activation) data contained in marshalled form.
restart - if true, the object is restarted when the activator is restarted; if false, the object is activated on demand.
Throws:
IllegalArgumentException - if groupID is null
Since:
JDK1.2
Method Detail

getGroupID

public ActivationGroupID getGroupID()
Returns the group identifier for the object specified by this descriptor. A group provides a way to aggregate objects into a single Java virtual machine. RMI creates/activates objects with the same groupID in the same virtual machine.
Returns:
the group identifier
Since:
JDK1.2

getClassName

public String getClassName()
Returns the class name for the object specified by this descriptor.
Returns:
the class name
Since:
JDK1.2

getLocation

public String getLocation()
Returns the code location for the object specified by this descriptor.
Returns:
the code location
Since:
JDK1.2

getData

public MarshalledObject getData()
Returns a "marshalled object" containing intialization/activation data for the object specified by this descriptor.
Returns:
the object specific "initialization" data
Since:
JDK1.2

getRestartMode

public boolean getRestartMode()
Returns the "restart" mode of the object associated with this activation descriptor.
Returns:
true if the activatable object associated with this activation descriptor should be restarted via the activation daemon when the daemon comes up; otherwise it returns false (meaning that the object is only activated on demand via a method call).
Since:
JDK1.2

equals

public boolean equals(Object obj)
Compares two activation descriptors for content equality.
Parameters:
obj - the Object to compare with
Returns:
true if these Objects are equal; false otherwise.
Overrides:
equals in class Object
Since:
JDK1.2
See Also:
Hashtable

hashCode

public int hashCode()
Return the same hashCode for similar ActivationDescs.
Returns:
an integer
Overrides:
hashCode in class Object
See Also:
Hashtable

Java Platform 1.2

Submit a bug or feature Version 1.2 of Java Platform API Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.