java.rmi.activation

Class ActivationDesc

Implemented Interfaces:
Serializable

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:
1.2
See Also:
Activatable, Serialized Form

Constructor Summary

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.
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.

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, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

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.

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.

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:
1.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 (reactivated) when either the activator is restarted or the object's activation group is restarted after an unexpected crash; if false, the object is only activated on demand. Specifying restart to be true does not force an initial immediate activation of a newly registered object; initial activation is lazy.
Throws:
ActivationException - if the current group is nonexistent
Since:
1.2
Usages and Demos :

View More Examples of ActivationDesc(String className,String location,MarshalledObject data,boolean restart)
   1:        ActivationDesc desc1=
   2: new ActivationDesc(id,"activate.HelloServiceImpl",classURL,param1);
   3:        ActivationDesc desc2=
   4:         ...
   5: new ActivationDesc(id,"activate.HelloServiceImpl",classURL,param2);
   6:        HelloService s1=(HelloService)Activatable.register(desc1);
   7:        HelloService s2=(HelloService)Activatable.register(desc2);
   8:        System.out.println(s1.getClass().getName());

View Full Code Here
   1: 
   2:          ActivationDesc desc1 = new ActivationDesc(id, "ProductImpl", classURL, p1param);
   3:         ...
   4:          ActivationDesc desc2 = new ActivationDesc(id, "ProductImpl", classURL, p2param);
   5:          
   6:          Product p1 = (Product) Activatable.register(desc1);
   7:          Product p2 = (Product) Activatable.register(desc2);

View Full Code Here

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.

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.

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:
1.2
Usages and Demos :

View More Examples of ActivationDesc(ActivationGroupID groupID,String className,String location,MarshalledObject data)
   1:        ActivationDesc desc1=
   2: new ActivationDesc(id,"activate.HelloServiceImpl",classURL,param1);
   3:        ActivationDesc desc2=
   4:         ...
   5: new ActivationDesc(id,"activate.HelloServiceImpl",classURL,param2);
   6:        HelloService s1=(HelloService)Activatable.register(desc1);
   7:        HelloService s2=(HelloService)Activatable.register(desc2);
   8:        System.out.println(s1.getClass().getName());

View Full Code Here
   1: 
   2:          ActivationDesc desc1 = new ActivationDesc(id, "ProductImpl", classURL, p1param);
   3:         ...
   4:          ActivationDesc desc2 = new ActivationDesc(id, "ProductImpl", classURL, p2param);
   5:          
   6:          Product p1 = (Product) Activatable.register(desc1);
   7:          Product p2 = (Product) Activatable.register(desc2);

View Full Code Here

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 (reactivated) when either the activator is restarted or the object's activation group is restarted after an unexpected crash; if false, the object is only activated on demand. Specifying restart to be true does not force an initial immediate activation of a newly registered object; initial activation is lazy.
Throws:
IllegalArgumentException - if groupID is null
Since:
1.2

Method Details

equals

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

getClassName

public String getClassName()
Returns the class name for the object specified by this descriptor.
Returns:
the class name
Since:
1.2
Usages and Demos :

View More Examples of getClassName()
   1: import java.rmi.activation.Activatable;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.ActivationException;
   4:         ...
   5:         dbgLoader.println("ActivateWrapper::register: "
   6:             + "Packaging ActivationDesc ");
   7:     }
   8:         ...
   9:     ActivationDesc adesc =
  10:         new ActivationDesc(gid,
  11:         ...
  12:     sys.setActivationDesc(aid, new ActivationDesc(adesc.getGroupID(),
  13:                               adesc.getClassName(),

View Full Code Here
   1: import java.rmi.activation.Activatable;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.ActivationException;
   4:         ...
   5:         dbgLoader.println("ActivateWrapper::register: "
   6:             + "Packaging ActivationDesc ");
   7:     }
   8:         ...
   9:     ActivationDesc adesc =
  10:         new ActivationDesc(gid,
  11:         ...
  12:     sys.setActivationDesc(aid, new ActivationDesc(adesc.getGroupID(),
  13:                               adesc.getClassName(),

View Full Code Here
   1: import java.rmi.activation.ActivationGroupID;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.ActivationID;
   4:         ...
   5:                 ActivationSystem sys = ActivationGroup.getSystem();
   6:                 ActivationDesc desc = sys.getActivationDesc(activationID);
   7:         ...
   8:                 desc = new ActivationDesc(desc.getGroupID(),
   9:         ...
  10:                               desc.getClassName(),

View Full Code Here
   1: import java.rmi.activation.ActivationID;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.Activatable;
   4:         ...
   5:                 ActivationSystem sys = ActivationGroup.getSystem();
   6:                 ActivationDesc desc = sys.getActivationDesc
   7:                                                                (activationID);
   8:         ...
   9:                 desc = new ActivationDesc(desc.getGroupID(),
  10:         ...
  11:                               desc.getClassName(),

View Full Code Here
   1: import java.rmi.activation.ActivationID;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.Activatable;
   4:         ...
   5:                 ActivationSystem sys = ActivationGroup.getSystem();
   6:                 ActivationDesc desc = sys.getActivationDesc
   7:                                                                (activationID);
   8:         ...
   9:                 desc = new ActivationDesc(desc.getGroupID(),
  10:         ...
  11:                               desc.getClassName(),

View Full Code Here

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:
1.2

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:
1.2
Usages and Demos :

View More Examples of getGroupID()
   1: import java.rmi.RemoteException;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.ActivationException;
   4:         ...
   5: 
   6:     ActivationDesc desc = (ActivationDesc) descriptions.get(id);
   7:     if (desc == null)
   8:         ...
   9:     ActivationInstantiator group = 
  10:       (ActivationInstantiator) groupInstantiators.get(desc.getGroupID());
  11: 
  12:         ...
  13:       {
  14:         ActivationGroupID gid = desc.getGroupID();

View Full Code Here
   1: import java.rmi.activation.Activatable;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.ActivationException;
   4:         ...
   5:         dbgLoader.println("ActivateWrapper::register: "
   6:             + "Packaging ActivationDesc ");
   7:     }
   8:         ...
   9:     ActivationDesc adesc =
  10:         new ActivationDesc(gid,
  11:         ...
  12:     }
  13:     sys.setActivationDesc(aid, new ActivationDesc(adesc.getGroupID(),

View Full Code Here
   1: import java.rmi.activation.Activatable;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.ActivationException;
   4:         ...
   5:         dbgLoader.println("ActivateWrapper::register: "
   6:             + "Packaging ActivationDesc ");
   7:     }
   8:         ...
   9:     ActivationDesc adesc =
  10:         new ActivationDesc(gid,
  11:         ...
  12:     }
  13:     sys.setActivationDesc(aid, new ActivationDesc(adesc.getGroupID(),

View Full Code Here
   1: import java.rmi.activation.ActivationGroupID;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.ActivationID;
   4:         ...
   5:                 ActivationSystem sys = ActivationGroup.getSystem();
   6:                 ActivationDesc desc = sys.getActivationDesc(activationID);
   7:         ...
   8:                 desc = new ActivationDesc(desc.getGroupID(),
   9:                               desc.getClassName(),

View Full Code Here
   1: import java.rmi.activation.ActivationID;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.Activatable;
   4:         ...
   5:                 ActivationSystem sys = ActivationGroup.getSystem();
   6:                 ActivationDesc desc = sys.getActivationDesc
   7:                                                                (activationID);
   8:         ...
   9:                 desc = new ActivationDesc(desc.getGroupID(),
  10:                               desc.getClassName(),

View Full Code Here

getLocation

public String getLocation()
Returns the code location for the object specified by this descriptor.
Returns:
the code location
Since:
1.2
Usages and Demos :

View More Examples of getLocation()
   1: import java.rmi.activation.Activatable;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.ActivationException;
   4:         ...
   5:         dbgLoader.println("ActivateWrapper::register: "
   6:             + "Packaging ActivationDesc ");
   7:     }
   8:         ...
   9:     ActivationDesc adesc =
  10:         new ActivationDesc(gid,
  11:         ...
  12:                               adesc.getClassName(),
  13:                               adesc.getLocation(),

View Full Code Here
   1: import java.rmi.activation.Activatable;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.ActivationException;
   4:         ...
   5:         dbgLoader.println("ActivateWrapper::register: "
   6:             + "Packaging ActivationDesc ");
   7:     }
   8:         ...
   9:     ActivationDesc adesc =
  10:         new ActivationDesc(gid,
  11:         ...
  12:                               adesc.getClassName(),
  13:                               adesc.getLocation(),

View Full Code Here
   1: import java.rmi.activation.ActivationGroupID;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.ActivationID;
   4:         ...
   5:                 ActivationSystem sys = ActivationGroup.getSystem();
   6:                 ActivationDesc desc = sys.getActivationDesc(activationID);
   7:         ...
   8:                 desc = new ActivationDesc(desc.getGroupID(),
   9:                               desc.getClassName(),
  10:         ...
  11:                               desc.getLocation(),

View Full Code Here
   1: import java.rmi.activation.ActivationID;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.Activatable;
   4:         ...
   5:                 ActivationSystem sys = ActivationGroup.getSystem();
   6:                 ActivationDesc desc = sys.getActivationDesc
   7:                                                                (activationID);
   8:         ...
   9:                 desc = new ActivationDesc(desc.getGroupID(),
  10:                               desc.getClassName(),
  11:         ...
  12:                               desc.getLocation(),

View Full Code Here
   1: import java.rmi.activation.ActivationID;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.Activatable;
   4:         ...
   5:                 ActivationSystem sys = ActivationGroup.getSystem();
   6:                 ActivationDesc desc = sys.getActivationDesc
   7:                                                                (activationID);
   8:         ...
   9:                 desc = new ActivationDesc(desc.getGroupID(),
  10:                               desc.getClassName(),
  11:         ...
  12:                               desc.getLocation(),

View Full Code Here

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 is restarted via the activation daemon when either the daemon comes up or the object's group is restarted after an unexpected crash; otherwise it returns false, meaning that the object is only activated on demand via a method call. Note that if the restart mode is true, the activator does not force an initial immediate activation of a newly registered object; initial activation is lazy.
Since:
1.2
Usages and Demos :

View More Examples of getRestartMode()
   1: import java.rmi.activation.Activatable;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.ActivationException;
   4:         ...
   5:         dbgLoader.println("ActivateWrapper::register: "
   6:             + "Packaging ActivationDesc ");
   7:     }
   8:         ...
   9:     ActivationDesc adesc =
  10:         new ActivationDesc(gid,
  11:         ...
  12:                               data,
  13:                               adesc.getRestartMode()));

View Full Code Here
   1: import java.rmi.activation.Activatable;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.ActivationException;
   4:         ...
   5:         dbgLoader.println("ActivateWrapper::register: "
   6:             + "Packaging ActivationDesc ");
   7:     }
   8:         ...
   9:     ActivationDesc adesc =
  10:         new ActivationDesc(gid,
  11:         ...
  12:                               data,
  13:                               adesc.getRestartMode()));

View Full Code Here
   1: import java.rmi.activation.ActivationGroupID;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.ActivationID;
   4:         ...
   5:                 ActivationSystem sys = ActivationGroup.getSystem();
   6:                 ActivationDesc desc = sys.getActivationDesc(activationID);
   7:         ...
   8:                 desc = new ActivationDesc(desc.getGroupID(),
   9:                               desc.getClassName(),
  10:         ...
  11:                               data,
  12:                               desc.getRestartMode());

View Full Code Here
   1: import java.rmi.activation.ActivationID;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.Activatable;
   4:         ...
   5:                 ActivationSystem sys = ActivationGroup.getSystem();
   6:                 ActivationDesc desc = sys.getActivationDesc
   7:                                                                (activationID);
   8:         ...
   9:                 desc = new ActivationDesc(desc.getGroupID(),
  10:                               desc.getClassName(),
  11:         ...
  12:                               data,
  13:                               desc.getRestartMode());

View Full Code Here
   1: import java.rmi.activation.ActivationID;
   2: import java.rmi.activation.ActivationDesc;
   3: import java.rmi.activation.Activatable;
   4:         ...
   5:                 ActivationSystem sys = ActivationGroup.getSystem();
   6:                 ActivationDesc desc = sys.getActivationDesc
   7:                                                                (activationID);
   8:         ...
   9:                 desc = new ActivationDesc(desc.getGroupID(),
  10:                               desc.getClassName(),
  11:         ...
  12:                               data,
  13:                               desc.getRestartMode());

View Full Code Here

hashCode

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