ActivationDescpublic final class ActivationDesc extends Object implements SerializableAn activation descriptor contains the information necessary to
activate an object:
- the object's group identifier,
- the object's fully-qualified class name,
- the object's code location (the location of the class), a codebase URL
path,
- the object's restart "mode", and,
- a "marshalled" object that can contain object specific
initialization data.
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. |
Fields Summary |
---|
private ActivationGroupID | groupID | private String | className | private String | location | private MarshalledObject | data | private boolean | restart | private static final long | serialVersionUIDindicate compatibility with the Java 2 SDK v1.2 version of class |
Constructors Summary |
---|
public 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 . 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.
Note that objects specified by a descriptor created with this
constructor will only be activated on demand (by default, the restart
mode is false ). If an activatable object requires restart
services, use one of the ActivationDesc constructors that
takes a boolean parameter, restart .
This constructor will throw ActivationException if
there is no current activation group for this VM. To create an
ActivationGroup use the
ActivationGroup.createGroup method.
this(ActivationGroup.internalCurrentGroupID(),
className, location, data, false);
| public 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 . 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.
this(ActivationGroup.internalCurrentGroupID(),
className, location, data, restart);
| 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.
Note that objects specified by a descriptor created with this
constructor will only be activated on demand (by default, the restart
mode is false ). If an activatable object requires restart
services, use one of the ActivationDesc constructors that
takes a boolean parameter, restart .
this(groupID, className, location, data, false);
| 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.
if (groupID == null)
throw new IllegalArgumentException("groupID can't be null");
this.groupID = groupID;
this.className = className;
this.location = location;
this.data = data;
this.restart = restart;
|
Methods Summary |
---|
public boolean | equals(java.lang.Object obj)Compares two activation descriptors for content equality.
if (obj instanceof ActivationDesc) {
ActivationDesc desc = (ActivationDesc) obj;
return
((groupID == null ? desc.groupID == null :
groupID.equals(desc.groupID)) &&
(className == null ? desc.className == null :
className.equals(desc.className)) &&
(location == null ? desc.location == null:
location.equals(desc.location)) &&
(data == null ? desc.data == null :
data.equals(desc.data)) &&
(restart == desc.restart));
} else {
return false;
}
| public java.lang.String | getClassName()Returns the class name for the object specified by this
descriptor.
return className;
| public java.rmi.MarshalledObject | getData()Returns a "marshalled object" containing intialization/activation
data for the object specified by this descriptor.
return data;
| 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.
return groupID;
| public java.lang.String | getLocation()Returns the code location for the object specified by
this descriptor.
return location;
| public boolean | getRestartMode()Returns the "restart" mode of the object associated with
this activation descriptor.
return restart;
| public int | hashCode()Return the same hashCode for similar ActivationDesc s.
return ((location == null
? 0
: location.hashCode() << 24) ^
(groupID == null
? 0
: groupID.hashCode() << 16) ^
(className == null
? 0
: className.hashCode() << 9) ^
(data == null
? 0
: data.hashCode() << 1) ^
(restart
? 1
: 0));
|
|