| public abstract class java.rmi.activation ActivationGroup
|
Java SE 6 |
ActivationGroup is responsible for creating new
instances of "activatable" objects in its group, informing its
ActivationMonitor when either: its object's become
active or inactive, or the group as a whole becomes inactive.
An ActivationGroup is initially created in one
of several ways:
ActivationDesc
without an explicit ActivationGroupID for the
first activatable object in the group, or
ActivationGroup.createGroup method
ActivationGroupDesc was only registered.
Only the activator can recreate an
ActivationGroup. The activator spawns, as needed, a
separate VM (as a child process, for example) for each registered
activation group and directs activation requests to the appropriate
group. It is implementation specific how VMs are spawned. An
activation group is created via the
ActivationGroup.createGroup static method. The
createGroup method has two requirements on the group
to be created: 1) the group must be a concrete subclass of
ActivationGroup, and 2) the group must have a
constructor that takes two arguments:
ActivationGroupID, and
java.rmi.MarshalledObject)
When created, the default implementation of
ActivationGroup will override the system properties
with the properties requested when its
ActivationGroupDesc was created, and will set a
java.rmi.RMISecurityManager as the default system
security manager. If your application requires specific properties
to be set when objects are activated in the group, the application
should create a special Properties object containing
these properties, then create an ActivationGroupDesc
with the Properties object, and use
ActivationGroup.createGroup before creating any
ActivationDescs (before the default
ActivationGroupDesc is created). If your application
requires the use of a security manager other than
java.rmi.RMISecurityManager, in the
ActivativationGroupDescriptor properties list you can set
java.security.manager property to the name of the security
manager you would like to install.
| version | 1.48, 05/11/17 |
| since | 1.2 |
| See also | java.rmi.activation.ActivationInstantiator, java.rmi.activation.ActivationGroupDesc, java.rmi.activation.ActivationGroupID |
| Constructors | |||||||
|---|---|---|---|---|---|---|---|
| protected | ActivationGroup(ActivationGroupID groupID) throws RemoteException Details
Constructs an activation group with the given activation group
identifier. The group is exported as a
java.rmi.server.UnicastRemoteObject.
| ||||||
| Methods | |||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| abstract public void | activeObject(ActivationID id, Remote obj) throws ActivationException, UnknownObjectException, RemoteException Details
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.
| ||||||||||||||||
| protected void | activeObject(ActivationID id, MarshalledObject mobj) throws ActivationException, UnknownObjectException, RemoteException Details
This protected method is necessary for subclasses to
make the activeObject callback to the group's
monitor. The call is simply forwarded to the group's
ActivationMonitor.
| ||||||||||||||||
| public static ActivationGroup | createGroup(ActivationGroupID id, ActivationGroupDesc desc, long incarnation) throws ActivationException Details
Create and set the activation group for the current VM. The
activation group can only be set if it is not currently set.
An activation group is set using the createGroup
method when the Activator initiates the
re-creation of an activation group in order to carry out
incoming activate requests. A group must first be
registered with the ActivationSystem before it can
be created via this method.
The group class specified by the
If the group class name specified in the
Note that if your application creates its own custom
activation group, a security manager must be set for that
group. Otherwise objects cannot be activated in the group.
If a security manager is already set in the group VM, this
method first calls the security manager's
After the group is created, the
Once a group is created, subsequent calls to the
| ||||||||||||||||
| public static ActivationGroupID | currentGroupID() Details
Returns the current activation group's identifier. Returns null
if no group is currently active for this VM.
| ||||||||||||||||
| protected void | inactiveGroup() throws UnknownGroupException, RemoteException Details
This protected method is necessary for subclasses to
make the inactiveGroup callback to the group's
monitor. The call is simply forwarded to the group's
ActivationMonitor. Also, the current group
for the VM is set to null.
| ||||||||||||||||
| public boolean | inactiveObject(ActivationID id) throws ActivationException, UnknownObjectException, RemoteException Details
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
After removing the object from the RMI runtime, the group
must inform its
This method simply informs the group's monitor that the object is inactive. It is up to the concrete subclass of ActivationGroup to fulfill the additional requirement of unexporting the object.
| ||||||||||||||||
| Properties | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public static void | setSystem(ActivationSystem system) throws ActivationException Details
Set the activation system for the VM. The activation system can
only be set it if no group is currently active. If the activation
system is not set via this call, then the getSystem
method attempts to obtain a reference to the
ActivationSystem by looking up the name
"java.rmi.activation.ActivationSystem" in the Activator's
registry. By default, the port number used to look up the
activation system is defined by
ActivationSystem.SYSTEM_PORT. This port can be overridden
by setting the property java.rmi.activation.port.
If there is a security manager, this method first
calls the security manager's
| ||||||||||
| public static ActivationSystem | getSystem() throws ActivationException Details
Returns the activation system for the VM. The activation system
may be set by the setSystem method. If the
activation system is not set via the setSystem
method, then the getSystem method attempts to
obtain a reference to the ActivationSystem by
looking up the name "java.rmi.activation.ActivationSystem" in
the Activator's registry. By default, the port number used to
look up the activation system is defined by
ActivationSystem.SYSTEM_PORT. This port can be
overridden by setting the property
java.rmi.activation.port.
| ||||||||||
| About DocWeb · Bundles · Export · Export All | Top 10 · Statistics · Login |
| About Sun · Contact · Privacy · Terms of Use · Trademarks | Java SE 6 · Copyright © 1994-2013 Sun Microsystems, Inc.All rights reserved. Use is subject to license terms |
![]() |
![]() |
|