java.rmi.activation

Interface ActivationSystem

All Superinterfaces:
Remote

public interface ActivationSystem
extends Remote

The ActivationSystem provides a means for registering groups and "activatable" objects to be activated within those groups. The ActivationSystem works closely with the Activator, which activates objects registered via the ActivationSystem, and the ActivationMonitor, which obtains information about active and inactive objects, and inactive groups.
Since:
1.2
See Also:
Activator, ActivationMonitor

Field Summary

static int
SYSTEM_PORT
The port to lookup the activation system.

Method Summary

ActivationMonitor
activeGroup(ActivationGroupID id, ActivationInstantiator group, long incarnation)
Callback to inform activation system that group is now active.
ActivationDesc
getActivationDesc(ActivationID id)
Returns the activation descriptor, for the object with the activation identifier, id.
ActivationGroupDesc
getActivationGroupDesc(ActivationGroupID id)
Returns the activation group descriptor, for the group with the activation group identifier, id.
ActivationGroupID
registerGroup(ActivationGroupDesc desc)
Register the activation group.
ActivationID
registerObject(ActivationDesc desc)
The registerObject method is used to register an activation descriptor, desc, and obtain an activation identifier for a activatable remote object.
ActivationDesc
setActivationDesc(ActivationID id, ActivationDesc desc)
Set the activation descriptor, desc for the object with the activation identifier, id.
ActivationGroupDesc
setActivationGroupDesc(ActivationGroupID id, ActivationGroupDesc desc)
Set the activation group descriptor, desc for the object with the activation group identifier, id.
void
shutdown()
Shutdown the activation system.
void
unregisterGroup(ActivationGroupID id)
Remove the activation group.
void
unregisterObject(ActivationID id)
Remove the activation id and associated descriptor previously registered with the ActivationSystem; the object can no longer be activated via the object's activation id.

Field Details

SYSTEM_PORT

public static final int SYSTEM_PORT
The port to lookup the activation system.
Field Value:
1098

Method Details

activeGroup

public ActivationMonitor activeGroup(ActivationGroupID id,
                                     ActivationInstantiator group,
                                     long incarnation)
            throws UnknownGroupException,
                   ActivationException,
                   RemoteException
Callback to inform activation system that group is now active. This call is made internally by the ActivationGroup.createGroup method to inform the ActivationSystem that the group is now active.
Parameters:
id - the activation group's identifier
group - the group's instantiator
incarnation - the group's incarnation number
Returns:
monitor for activation group
Throws:
UnknownGroupException - if group is not registered
ActivationException - if a group for the specified id is already active and that group is not equal to the specified group or that group has a different incarnation than the specified group
RemoteException - if remote call fails
Since:
1.2

getActivationDesc

public ActivationDesc getActivationDesc(ActivationID id)
            throws ActivationException,
                   UnknownObjectException,
                   RemoteException
Returns the activation descriptor, for the object with the activation identifier, id.
Parameters:
id - the activation identifier for the activatable object
Returns:
the activation descriptor
Throws:
UnknownObjectException - if id is not registered
ActivationException - for general failure
RemoteException - if remote call fails
Since:
1.2

getActivationGroupDesc

public ActivationGroupDesc getActivationGroupDesc(ActivationGroupID id)
            throws ActivationException,
                   UnknownGroupException,
                   RemoteException
Returns the activation group descriptor, for the group with the activation group identifier, id.
Parameters:
id - the activation group identifier for the group
Returns:
the activation group descriptor
Throws:
UnknownGroupException - if id is not registered
ActivationException - for general failure
RemoteException - if remote call fails
Since:
1.2

registerGroup

public ActivationGroupID registerGroup(ActivationGroupDesc desc)
            throws ActivationException,
                   RemoteException
Register the activation group. An activation group must be registered with the ActivationSystem before objects can be registered within that group.
Parameters:
desc - the group's descriptor
Returns:
an identifier for the group
Throws:
ActivationException - if group registration fails
RemoteException - if remote call fails
Since:
1.2

registerObject

public ActivationID registerObject(ActivationDesc desc)
            throws ActivationException,
                   UnknownGroupException,
                   RemoteException
The registerObject method is used to register an activation descriptor, desc, and obtain an activation identifier for a activatable remote object. The ActivationSystem creates an ActivationID (a activation identifier) for the object specified by the descriptor, desc, and records, in stable storage, the activation descriptor and its associated identifier for later use. When the Activator receives an activate request for a specific identifier, it looks up the activation descriptor (registered previously) for the specified identifier and uses that information to activate the object.

Parameters:
desc - the object's activation descriptor
Returns:
the activation id that can be used to activate the object
Throws:
ActivationException - if registration fails (e.g., database update failure, etc).
UnknownGroupException - if group referred to in desc is not registered with this system
RemoteException - if remote call fails
Since:
1.2

setActivationDesc

public ActivationDesc setActivationDesc(ActivationID id,
                                        ActivationDesc desc)
            throws ActivationException,
                   UnknownObjectException,
                   UnknownGroupException,
                   RemoteException
Set the activation descriptor, desc for the object with the activation identifier, id. The change will take effect upon subsequent activation of the object.
Parameters:
id - the activation identifier for the activatable object
desc - the activation descriptor for the activatable object
Returns:
the previous value of the activation descriptor
Throws:
UnknownGroupException - the group associated with desc is not a registered group
UnknownObjectException - the activation id is not registered
ActivationException - for general failure (e.g., unable to update log)
RemoteException - if remote call fails
Since:
1.2
Usages and Demos :

View More Examples of setActivationDesc(ActivationID id,ActivationDesc desc)
   1: import java.rmi.activation.ActivationID;
   2: import java.rmi.activation.ActivationSystem;
   3: import java.rmi.activation.UnknownObjectException;
   4:         ...
   5:                     if (sharedActivationRef == null) {
   6:                 ActivationSystem sys = ActivationGroup.getSystem();
   7:                 ActivationDesc desc = sys.getActivationDesc(activationID);
   8:         ...
   9:                               desc.getRestartMode());
  10:                 sys.setActivationDesc(activationID, desc);
  11:                     sharedActivationRef.setInitializationData(activationID, data);
  12:         ...
  13:         System.err.println("Attempting to unregister with activation system");
  14:         ActivationSystem sys = ActivationGroup.getSystem();

View Full Code Here
   1: import java.rmi.activation.ActivationException;
   2: import java.rmi.activation.ActivationSystem;
   3: import java.rmi.activation.ActivationGroup;
   4:         ...
   5:                     if (sharedActivationRef == null) {
   6:                 ActivationSystem sys = ActivationGroup.getSystem();
   7:                 ActivationDesc desc = sys.getActivationDesc
   8:         ...
   9:                               desc.getRestartMode());
  10:                 sys.setActivationDesc(activationID, desc);
  11:                         sharedActivationRef.setInitializationData(activationID,

View Full Code Here
   1: import java.rmi.activation.ActivationException;
   2: import java.rmi.activation.ActivationSystem;
   3: import java.rmi.activation.ActivationGroup;
   4:         ...
   5:                     if (sharedActivationRef == null) {
   6:                 ActivationSystem sys = ActivationGroup.getSystem();
   7:                 ActivationDesc desc = sys.getActivationDesc
   8:         ...
   9:                               desc.getRestartMode());
  10:                 sys.setActivationDesc(activationID, desc);
  11:                         sharedActivationRef.setInitializationData(activationID,

View Full Code Here
   1: import java.rmi.activation.ActivationGroupID;
   2: import java.rmi.activation.ActivationSystem;
   3: import java.rmi.MarshalledObject;
   4:         ...
   5:                     if (sharedActivationRef == null) {
   6:                         ActivationSystem sys = ActivationGroup.getSystem();
   7:                         ActivationDesc desc = sys.getActivationDesc
   8:         ...
   9:                                                   desc.getRestartMode());
  10:                         sys.setActivationDesc(activationID, desc);
  11:                         sharedActivationRef.setInitializationData(activationID,

View Full Code Here

setActivationGroupDesc

public ActivationGroupDesc setActivationGroupDesc(ActivationGroupID id,
                                                  ActivationGroupDesc desc)
            throws ActivationException,
                   UnknownGroupException,
                   RemoteException
Set the activation group descriptor, desc for the object with the activation group identifier, id. The change will take effect upon subsequent activation of the group.
Parameters:
id - the activation group identifier for the activation group
desc - the activation group descriptor for the activation group
Returns:
the previous value of the activation group descriptor
Throws:
UnknownGroupException - the group associated with id is not a registered group
ActivationException - for general failure (e.g., unable to update log)
RemoteException - if remote call fails
Since:
1.2

shutdown

public void shutdown()
            throws RemoteException
Shutdown the activation system. Destroys all groups spawned by the activation daemon and exits the activation daemon.
Throws:
RemoteException - if failed to contact/shutdown the activation daemon
Since:
1.2

unregisterGroup

public void unregisterGroup(ActivationGroupID id)
            throws ActivationException,
                   UnknownGroupException,
                   RemoteException
Remove the activation group. An activation group makes this call back to inform the activator that the group should be removed (destroyed). If this call completes successfully, objects can no longer be registered or activated within the group. All information of the group and its associated objects is removed from the system.
Parameters:
id - the activation group's identifier
Throws:
ActivationException - if unregister fails (e.g., database update failure, etc).
UnknownGroupException - if group is not registered
RemoteException - if remote call fails
Since:
1.2
Usages and Demos :

View More Examples of unregisterGroup(ActivationGroupID id)
   1: import java.rmi.activation.ActivationID;
   2: import java.rmi.activation.ActivationSystem;
   3: import java.rmi.activation.ActivationGroup;
   4:         ...
   5:                    "system");
   6:         final ActivationSystem sys = ActivationGroup.getSystem();
   7:         if (sharedActivationRef != null) { 
   8:         ...
   9:         if (grp != null) {
  10:             sys.unregisterGroup(grp);           
  11:         } else {

View Full Code Here
   1: import java.rmi.activation.ActivationID;
   2: import java.rmi.activation.ActivationSystem;
   3: import java.rmi.activation.ActivationException;
   4:         ...
   5: );
   6:             ActivationSystem sys = ActivationGroup.getSystem();
   7:             System.err.println("Contacted activation system");
   8:         ...
   9:             if (grp != null) {
  10:                 sys.unregisterGroup(grp);
  11:             } else {

View Full Code Here
   1: import java.rmi.activation.ActivationID;
   2: import java.rmi.activation.ActivationSystem;
   3: import java.rmi.activation.ActivationException;
   4:         ...
   5: );
   6:             ActivationSystem sys = ActivationGroup.getSystem();
   7:             System.err.println("Contacted activation system");
   8:         ...
   9:             if (grp != null) {
  10:                 sys.unregisterGroup(grp);
  11:             } else {

View Full Code Here
   1:                     ActivationGroupID grp = ActivationGroup.currentGroupID();
   2:                     ActivationSystem sys = ActivationGroup.getSystem();
   3:                     if (grp != null && sys != null)
   4:         ...
   5:                         sys.unregisterGroup(grp);
   6:                     if (dbgDestroy != null) {
   7:                         dbgDestroy.println("TxnManagerImpl:destroy " +
   8:                             "unregistering object.");

View Full Code Here
   1:                 ActivationGroupID grp = ActivationGroup.currentGroupID();
   2:                 ActivationSystem sys = ActivationGroup.getSystem();
   3:                 if (grp != null && sys != null) 
   4:         ...
   5:                     sys.unregisterGroup(grp);
   6:                         if (dbgDestroy != null) { 
   7:                         dbgDestroy.println("BasicSpace:destroy " + 
   8:                         "unregistering object.");

View Full Code Here

unregisterObject

public void unregisterObject(ActivationID id)
            throws ActivationException,
                   UnknownObjectException,
                   RemoteException
Remove the activation id and associated descriptor previously registered with the ActivationSystem; the object can no longer be activated via the object's activation id.
Parameters:
id - the object's activation id (from previous registration)
Throws:
ActivationException - if unregister fails (e.g., database update failure, etc).
UnknownObjectException - if object is unknown (not registered)
RemoteException - if remote call fails
Since:
1.2
Usages and Demos :

View More Examples of unregisterObject(ActivationID id)
   1: import java.rmi.activation.ActivationID;
   2: import java.rmi.activation.ActivationSystem;
   3: import java.rmi.activation.ActivationGroup;
   4:         ...
   5:                    "system");
   6:         final ActivationSystem sys = ActivationGroup.getSystem();
   7:         if (sharedActivationRef != null) { 
   8:         ...
   9:         sys.unregisterObject(activationID);
  10:         System.err.println("Unregistered object with activation " +

View Full Code Here
   1: import java.rmi.activation.ActivationException;
   2: import java.rmi.activation.ActivationSystem;
   3: import java.rmi.activation.Activatable;
   4:         ...
   5:     private ActivationID theActivationID;
   6:     private ActivationSystem theActivationSystem;
   7: 
   8:         ...
   9:                 theActivationSystem =
  10:                     (ActivationSystem) mySysPreparer.prepareProxy(ActivationGroup.getSystem());
  11:             } catch (ActivationException anAE) {
  12:         ...
  13:                 try {
  14:                     theActivationSystem.unregisterObject(theActivationID);

View Full Code Here
   1: import java.rmi.activation.ActivationID;
   2: import java.rmi.activation.ActivationSystem;
   3: import java.rmi.activation.UnknownObjectException;
   4:         ...
   5:                     if (sharedActivationRef == null) {
   6:                 ActivationSystem sys = ActivationGroup.getSystem();
   7:                 ActivationDesc desc = sys.getActivationDesc(activationID);
   8:         ...
   9:         System.err.println("Attempting to unregister with activation system");
  10:         ActivationSystem sys = ActivationGroup.getSystem();
  11:             System.err.println("Contacted activation system");
  12:         ...
  13:         sys.unregisterObject(activationID);

View Full Code Here