java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
java.rmi.activation.ActivationGroup
public abstract class ActivationGroup
An 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.
ActivationInstantiator,
ActivationGroupDesc,
ActivationGroupID,
Serialized Form| Field Summary |
|---|
| Fields inherited from class java.rmi.server.RemoteObject |
|---|
ref |
| Constructor Summary | |
|---|---|
protected |
ActivationGroup(ActivationGroupID groupID)
Constructs an activation group with the given activation group identifier. |
| Method Summary | |
|---|---|
protected void |
activeObject(ActivationID id,
MarshalledObject mobj)
This protected method is necessary for subclasses to make the activeObject callback to the group's
monitor. |
abstract void |
activeObject(ActivationID id,
Remote obj)
The group's activeObject method is called when an
object is exported (either by Activatable object
construction or an explicit call to
Activatable.exportObject. |
static ActivationGroup |
createGroup(ActivationGroupID id,
ActivationGroupDesc desc,
long incarnation)
Create and set the activation group for the current VM. |
static ActivationGroupID |
currentGroupID()
Returns the current activation group's identifier. |
static ActivationSystem |
getSystem()
Returns the activation system for the VM. |
protected void |
inactiveGroup()
This protected method is necessary for subclasses to make the inactiveGroup callback to the group's
monitor. |
boolean |
inactiveObject(ActivationID id)
The group's inactiveObject method is called
indirectly via a call to the Activatable.inactive
method. |
static void |
setSystem(ActivationSystem system)
Set the activation system for the VM. |
| Methods inherited from class java.rmi.server.UnicastRemoteObject |
|---|
clone, exportObject, exportObject, exportObject, unexportObject |
| Methods inherited from class java.rmi.server.RemoteServer |
|---|
getClientHost, getLog, setLog |
| Methods inherited from class java.rmi.server.RemoteObject |
|---|
equals, getRef, hashCode, toString, toStub |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.rmi.activation.ActivationInstantiator |
|---|
newInstance |
| Constructor Detail |
|---|
protected ActivationGroup(ActivationGroupID groupID) throws RemoteException
java.rmi.server.UnicastRemoteObject.
groupID - the group's identifier
RemoteException - if this group could not be exported| Method Detail |
|---|
public boolean inactiveObject(ActivationID id) throws ActivationException, UnknownObjectException, RemoteException
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. An object will only be unexported
if the object has no pending or executing calls.
The subclass of ActivationGroup must override this
method and unexport the object.
After removing the object from the RMI runtime, the group
must inform 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.
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.
id - the object's activation identifier
UnknownObjectException - if object is unknown (may already
be inactive)
RemoteException - if call informing monitor fails
ActivationException - if group is inactivepublic abstract void activeObject(ActivationID id, Remote obj) throws ActivationException, UnknownObjectException, RemoteException
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.
id - the object's identifierobj - the remote object implementation
UnknownObjectException - if object is not registered
RemoteException - if call informing monitor fails
ActivationException - if group is inactivepublic static ActivationGroup createGroup(ActivationGroupID id, ActivationGroupDesc desc, long incarnation) throws ActivationException
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.
id - the activation group's identifierdesc - the activation group's descriptorincarnation - the group's incarnation number (zero on group's
initial creation)
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")SecurityManager.checkSetFactory()public static ActivationGroupID currentGroupID()
public static void setSystem(ActivationSystem system) throws ActivationException
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 checkSetFactory method.
This could result in a SecurityException.
system - remote reference to the ActivationSystem
ActivationException - if activation system is already set
SecurityException - if permission to set the activation system is denied.
(Note: The default implementation of the security manager
checkSetFactory
method requires the RuntimePermission "setFactory")getSystem(),
SecurityManager.checkSetFactory()public static ActivationSystem getSystem() throws ActivationException
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.
ActivationException - if activation system cannot be
obtained or is not bound
(means that it is not running)setSystem(java.rmi.activation.ActivationSystem)protected void activeObject(ActivationID id, MarshalledObject mobj) throws ActivationException, UnknownObjectException, RemoteException
activeObject callback to the group's
monitor. The call is simply forwarded to the group's
ActivationMonitor.
id - the object's identifiermobj - a marshalled object containing the remote object's stub
UnknownObjectException - if object is not registered
RemoteException - if call informing monitor fails
ActivationException - if an activation error occurs
protected void inactiveGroup()
throws UnknownGroupException,
RemoteException
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.
UnknownGroupException - if group is not registered
RemoteException - if call informing monitor failsCes informations proviennent du site de http://java.sun.com
Le contenu de cette page provient du site de Sun, et est généré depuis un cache sur l'infobrol après certains traitements automatisés. La présentation peut donc différer du document original, mais le contenu aussi. Vous pouvez utiliser ce bouton pour afficher la page originale du site de Sun :
Maintenir les pages en cache sur différents sites peut offrir plus de disponibilité.
Chaque page est indexée dans la base de donnée, ce qui permet de retrouver facilement les informations, au moyen des sommaires, du moteur de recherche interne, etc.
Des facilités sont mises en place pour que les membres de l'infobrol puissent effectuer des traductions en français des différents documents. Ceci devrait permettre aux débutants en programmation Java de consulter les API en français s'ils maîtrisent moins bien la langue de Shakespeare. Dans le cas où une traduction a été soumise, elle est disponible au moyen d'un lien en bas de page. Si la traduction a été validée, la page s'affiche par défaut en français, et un lien en bas de page permet d'atteindre la version en anglais.
Le code sur l'infobrol est automatiquement coloré selon la syntaxe, et les différents mots clés sont transformés en liens pour accéder rapidement aux informations.
Vous avez la possibilité de partager vos expériences en proposant vos propres extraits de code en utilisant le bouton "ajouter un commentaire" en bas de page. Si vous visitez simplement l'infobrol, vous avez déjà accès à cette fonction, mais si vous étes membre du brol, vous pouvez en plus utiliser des boutons supplémentaires de mise en forme, dont la coloration automatique de vos extraits de codes.
Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher les interactions avec les réseaux sociaux sur ces pages.
7 mots clés dont 0 définis manuellement (plus d'information...).
Avertissement
Cette page ne possède pas encore de mots clés manuels, ceci est donc un exemple automatique (les niveaux de pertinence sont fictifs, mais les liens sont valables). Pour tester le nuage avec une page qui contient des mots définis manuellement, vous pouvez cliquer ici.Vous pouvez modifier vos préférences dans votre profil pour ne plus afficher le nuage de mots clés.
Recherche (afficher)
Utilisateur (masquer)
Navigation (masquer)
Apparence (afficher)
Stats (afficher)
Citation (masquer)