java.rmi.activation
Interface ActivationSystem

All Superinterfaces:
Remote

public interface ActivationSystem
extends Remote

The ActivationSystem registers groups and activatable objects to be activated within those groups. The ActivationSystem cooperates with both the Activator, which activates objects registered via the ActivationSystem, and the ActivationMonitor, which obtains information about active and inactive objects and inactive groups.

The activation system if frequently a remote object. As a security mean, all methods in this interface throw AccessException if called from the client that is not reside on the same host as the activation system.

See Also:
ActivationGroup.getSystem()

Field Summary
static int SYSTEM_PORT
          The port, used by the activation system.
 
Method Summary
 ActivationMonitor activeGroup(ActivationGroupID id, ActivationInstantiator group, long incarnation)
          This method is called from the ActivationGroup to inform the ActivatinSystem that the group is now active and there is the ActivationInstantiator for that group.
 ActivationDesc getActivationDesc(ActivationID id)
          Get the activation descriptor for the object with the given activation id.
 ActivationGroupDesc getActivationGroupDesc(ActivationGroupID groupId)
          Get the group descriptor for the group with the given id.
 ActivationGroupID registerGroup(ActivationGroupDesc groupDesc)
          Register the new activation group.
 ActivationID registerObject(ActivationDesc desc)
          Registers the activation descriptor and creates (and returns) its activation identifier.
 ActivationDesc setActivationDesc(ActivationID id, ActivationDesc desc)
          Replace the activation descriptor for the object with the given activation id.
 ActivationGroupDesc setActivationGroupDesc(ActivationGroupID groupId, ActivationGroupDesc groupDesc)
          Replaces the group descriptor for the group with the given group activation id.
 void shutdown()
          Shutdown the activation system and all associated activation groups
 void unregisterGroup(ActivationGroupID id)
          Removes the activation group with the given identifier.
 void unregisterObject(ActivationID id)
          Removes the stored identifier-description map entry.
 

Field Detail

SYSTEM_PORT

static final int SYSTEM_PORT
The port, used by the activation system. The value is equal to 1098 by default, but it can be changed by putting the system property .

See Also:
Constant Field Values
Method Detail

registerObject

ActivationID registerObject(ActivationDesc desc)
                            throws ActivationException,
                                   UnknownGroupException,
                                   RemoteException
Registers the activation descriptor and creates (and returns) its activation identifier. The map entry (identifier to descriptor) is stored in the stable map and used when the Activator receives the request to activate the object.

Parameters:
desc - the activation descriptor to register.
Returns:
the created activation identifier that is mapped to the passed descriptor.
Throws:
ActivationException - if the registration fails (database update problems, etc).
UnknownGroupException - the if group, specified in decriptor, is unknown.
RemoteException - if the remote call fails.

unregisterObject

void unregisterObject(ActivationID id)
                      throws ActivationException,
                             UnknownObjectException,
                             RemoteException
Removes the stored identifier-description map entry. The object will no longer be activable using the passed activation id

Parameters:
id - the activation id to remove
Throws:
ActivationException - if the entry removing operation failed (database update problems, etc)
UnknownObjectException - if the passed id is not known to the system
RemoteException - if the remote call fails

registerGroup

ActivationGroupID registerGroup(ActivationGroupDesc groupDesc)
                                throws ActivationException,
                                       RemoteException
Register the new activation group. For instance, it can be one activation group per virtual machine.

Parameters:
groupDesc - the activation group descriptor.
Returns:
the created activation group ID for the activation group
Throws:
ActivationException - if the group registration fails
RemoteException - if the remote call fails

activeGroup

ActivationMonitor activeGroup(ActivationGroupID id,
                              ActivationInstantiator group,
                              long incarnation)
                              throws UnknownGroupException,
                                     ActivationException,
                                     RemoteException
This method is called from the ActivationGroup to inform the ActivatinSystem that the group is now active and there is the ActivationInstantiator for that group. This call is made internally from the ActivationGroup.createGroup(java.rmi.activation.ActivationGroupID, java.rmi.activation.ActivationGroupDesc, long).

Parameters:
id - the group id
group - the group activation instantiator
incarnation - the groups incarnatin number.
Returns:
the activation monitor that should be informed about the group state changes
Throws:
UnknownGroupException - if this group has not been registered
ActivationException - if this group is already active
RemoteException - if the remote call fails

unregisterGroup

void unregisterGroup(ActivationGroupID id)
                     throws ActivationException,
                            UnknownGroupException,
                            RemoteException
Removes the activation group with the given identifier. The group calls back, informing the activator about the shutdown.

Parameters:
id - the group activation id.
Throws:
ActivationException - if the database update fails
UnknownGroupException - if such group is not registered
RemoteException - if the remote call fails

shutdown

void shutdown()
              throws RemoteException
Shutdown the activation system and all associated activation groups

Throws:
RemoteException - if the remote call fails

setActivationDesc

ActivationDesc setActivationDesc(ActivationID id,
                                 ActivationDesc desc)
                                 throws ActivationException,
                                        UnknownObjectException,
                                        UnknownGroupException,
                                        RemoteException
Replace the activation descriptor for the object with the given activation id.

Parameters:
id - the activation id
desc - the new activation descriptor
Returns:
the previous activation descriptor for that object.
Throws:
ActivationException - if the database update fails
UnknownObjectException - if the object with such id is not known
UnknownGroupException - if the activation group (in desc) is not known.
RemoteException - if the remote call fails

setActivationGroupDesc

ActivationGroupDesc setActivationGroupDesc(ActivationGroupID groupId,
                                           ActivationGroupDesc groupDesc)
                                           throws ActivationException,
                                                  UnknownGroupException,
                                                  RemoteException
Replaces the group descriptor for the group with the given group activation id.

Parameters:
groupId - the group id
groupDesc - the new group descriptor
Returns:
the previous group descriptor
Throws:
ActivationException - if the database update fails
UnknownGroupException - if such group is not known
RemoteException - if the remote call fails

getActivationDesc

ActivationDesc getActivationDesc(ActivationID id)
                                 throws ActivationException,
                                        UnknownObjectException,
                                        RemoteException
Get the activation descriptor for the object with the given activation id.

Parameters:
id - the object activation id
Returns:
the activation descriptor for that object
Throws:
ActivationException - if the database access fails
UnknownObjectException - if this object is not known
RemoteException - if the remote call fails

getActivationGroupDesc

ActivationGroupDesc getActivationGroupDesc(ActivationGroupID groupId)
                                           throws ActivationException,
                                                  UnknownGroupException,
                                                  RemoteException
Get the group descriptor for the group with the given id.

Parameters:
groupId - the group id
Returns:
the group descriptor
Throws:
ActivationException - if the database access fails
UnknownGroupException - if the group with such id is not known
RemoteException - if the remote call fails