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
ActivationGroupDesc
must be a concrete subclass of
ActivationGroup
and have a public constructor that
takes two arguments: the ActivationGroupID
for the
group and the MarshalledObject
containing the
group's initialization data (obtained from the
ActivationGroupDesc
.
If the group class name specified in the
ActivationGroupDesc
is null
, then
this method will behave as if the group descriptor contained
the name of the default activation group implementation class.
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.
java.rmi.RMISecurityManager
is set by default.
If a security manager is already set in the group VM, this
method first calls the security manager's
checkSetFactory
method. This could result in a
SecurityException
. If your application needs to
set a different security manager, you must ensure that the
policy file specified by the group's
ActivationGroupDesc
grants the group the necessary
permissions to set a new security manager. (Note: This will be
necessary if your group downloads and sets a security manager).
After the group is created, the
ActivationSystem
is informed that the group is
active by calling the activeGroup
method which
returns the ActivationMonitor
for the group. The
application need not call activeGroup
independently since it is taken care of by this method.
Once a group is created, subsequent calls to the
currentGroupID
method will return the identifier
for this group until the group becomes inactive.
Returns:
the activation group for the VM
Parameters:
- id - the activation group's identifier
- desc - the activation group's descriptor
- incarnation - the group's incarnation number (zero on group's
initial creation)
Throws:
- ActivationException - if group already exists or if error
occurs during group creation
- SecurityException - if permission to create group is denied.
(Note: The default implementation of the security manager
checkSetFactory
method requires the RuntimePermission "setFactory")
Since:
1.2
See Also:
SecurityManager.checkSetFactory()
,