public class

ActivationGroupImpl

extends ActivationGroup
java.lang.Object
   ↳ java.rmi.server.RemoteObject
     ↳ java.rmi.server.RemoteServer
       ↳ java.rmi.server.UnicastRemoteObject
         ↳ java.rmi.activation.ActivationGroup
           ↳ sun.rmi.server.ActivationGroupImpl

Class Overview

The default activation group implementation.

See Also

Summary

[Expand]
Inherited Fields
From class java.rmi.server.RemoteObject
Public Constructors
ActivationGroupImpl(ActivationGroupID id, MarshalledObject<?> data)
Creates a default activation group implementation.
Public Methods
void activeObject(ActivationID id, Remote impl)
The group's activeObject method is called when an object is exported (either by Activatable object construction or an explicit call to Activatable.exportObject.
boolean inactiveObject(ActivationID id)
The group's inactiveObject method is called indirectly via a call to the Activatable.inactive method.
MarshalledObject<? extends Remote> newInstance(ActivationID id, ActivationDesc desc)
Creates a new instance of an activatable remote object.
[Expand]
Inherited Methods
From class java.rmi.activation.ActivationGroup
From class java.rmi.server.UnicastRemoteObject
From class java.rmi.server.RemoteServer
From class java.rmi.server.RemoteObject
From class java.lang.Object
From interface java.rmi.activation.ActivationInstantiator

Public Constructors

public ActivationGroupImpl (ActivationGroupID id, MarshalledObject<?> data)

Creates a default activation group implementation.

Parameters
id the group's identifier
data ignored

Public Methods

public void activeObject (ActivationID id, Remote impl)

The group's activeObject method is called when an object is exported (either by Activatable object construction or an explicit call to Activatable.exportObject. The group must inform its ActivationMonitor that the object is active (via the monitor's activeObject method) if the group hasn't already done so.

Parameters
id the object's identifier
impl the remote object implementation
Throws
UnknownObjectException if object is not registered
RemoteException if call informing monitor fails
ActivationException

public boolean inactiveObject (ActivationID id)

The group's inactiveObject method is called indirectly via a call to the Activatable.inactive method. A remote object implementation must call Activatable's inactive method when that object deactivates (the object deems that it is no longer active). If the object does not call Activatable.inactive when it deactivates, the object will never be garbage collected since the group keeps strong references to the objects it creates.

The group's inactiveObject method unexports the remote object from the RMI runtime so that the object can no longer receive incoming RMI calls. This call will only succeed if the object has no pending/executing calls. If the object does have pending/executing RMI calls, then false will be returned. If the object has no pending/executing calls, the object is removed from the RMI runtime and the group informs its ActivationMonitor (via the monitor's inactiveObject method) that the remote object is not currently active so that the remote object will be re-activated by the activator upon a subsequent activation request.

Parameters
id the object's activation identifier
Returns
  • true if the object was successfully deactivated; otherwise returns false.
Throws
UnknownObjectException if object is unknown (may already be inactive)
RemoteException if call informing monitor fails
ActivationException

public MarshalledObject<? extends Remote> newInstance (ActivationID id, ActivationDesc desc)

Creates a new instance of an activatable remote object. The Activator calls this method to create an activatable object in this group. This method should be idempotent; a call to activate an already active object should return the previously activated object. Note: this method assumes that the Activator will only invoke newInstance for the same object in a serial fashion (i.e., the activator will not allow the group to see concurrent requests to activate the same object.

Parameters
id the object's activation identifier
desc the object's activation descriptor
Returns
  • a marshalled object containing the activated object's stub