java.rmi.activation

Class ActivationGroup

public abstract class ActivationGroup extends UnicastRemoteObject implements ActivationInstantiator

The entity that receives the request to activate object and activates it. Frequently there is one activation group per virtual machine.
Constructor Summary
protected ActivationGroup(ActivationGroupID aGroupId)
Create the new activation group with the given group id.
Method Summary
abstract voidactiveObject(ActivationID id, Remote obj)
The method is called when the object is exported.
protected voidactiveObject(ActivationID id, MarshalledObject mObject)
Makes the call back to the groups {@link ActivationMonitor}.
static ActivationGroupcreateGroup(ActivationGroupID id, ActivationGroupDesc desc, long incarnation)
Create the new instance of the activation group, using the class name and location information, stored in the passed descriptor.
static ActivationGroupIDcurrentGroupID()
Get the id of current activation group.
static ActivationSystemgetSystem()
Get the current activation system.
protected voidinactiveGroup()
Makes the call back to the groups {@link ActivationMonitor} and sets the current group to null.
booleaninactiveObject(ActivationID id)
Notifies the monitor about the object being inactivated.
static voidsetSystem(ActivationSystem aSystem)
Set the activation system for this virtual machine.

Constructor Detail

ActivationGroup

protected ActivationGroup(ActivationGroupID aGroupId)
Create the new activation group with the given group id.

Parameters: aGroupId the group Id.

Throws: RemoteException if the group export fails.

Method Detail

activeObject

public abstract void activeObject(ActivationID id, Remote obj)
The method is called when the object is exported. The group must notify the activation monitor, if this was not already done before.

Parameters: id the object activation id obj the remote object implementation

Throws: ActivationException if the group is inactive UnknownObjectException if such object is not known RemoteException if the call to monitor fails

activeObject

protected void activeObject(ActivationID id, MarshalledObject mObject)
Makes the call back to the groups {@link ActivationMonitor}.

Parameters: id the id obj the object being activated mObject the marshalled object, contains the activated remote object stub.

Throws: ActivationException on activation error UnknownObjectException if such object is not registered RemoteException on remote call (to monitor) error

createGroup

public static ActivationGroup createGroup(ActivationGroupID id, ActivationGroupDesc desc, long incarnation)
Create the new instance of the activation group, using the class name and location information, stored in the passed descriptor. The method expects the group class to have the two parameter constructor, the first parameter being the {@link ActivationGroupID} and the second the {@link MarshalledObject}. The group must be first be registered with the ActivationSystem. Once a group is created, the currentGroupID method returns the identifier for this group until the group becomes inactive.

Parameters: id the activation group id desc the group descriptor, providing the information, necessary to create the group incarnation the incarnation number

Returns: the created group instance

Throws: ActivationException if the activation fails due any reason

currentGroupID

public static ActivationGroupID currentGroupID()
Get the id of current activation group.

Returns: the id of the current activation group or null if none exists.

getSystem

public static ActivationSystem getSystem()
Get the current activation system. If the system is not set via {@link #setSystem} method, the default system for this virtual machine is returned. The default system is first searched by name "java.rmi.activation.ActivationSystem" on the activation registry port. The default value of the activation registry port is {@link ActivationSystem#SYSTEM_PORT}, but it can be changed by putting the system property java.rmi.activation.port. Both activation system and activation registry are provided by the RMI daemon tool, RMID, if it is running on the local host. If the RMID is not running, the internal transient activation system will be created and returned. This internal system is highly limited in in capabilities and is not intended to be used anywhere apart automated testing.

Returns: the activation system for this virtual machine

Throws: ActivationException

inactiveGroup

protected void inactiveGroup()
Makes the call back to the groups {@link ActivationMonitor} and sets the current group to null.

inactiveObject

public boolean inactiveObject(ActivationID id)
Notifies the monitor about the object being inactivated.

Parameters: id the object being inactivated.

Returns: true always (must be overridden to return other values).

Throws: ActivationException never UnknownObjectException if the object is not known RemoteException if the remote call to monitor fails

setSystem

public static void setSystem(ActivationSystem aSystem)
Set the activation system for this virtual machine. The system can only be set if no group is active.

Parameters: aSystem the system to set

Throws: ActivationException if some group is active now.