|
Generated by JDiff |
||||||||
PREV PACKAGE NEXT PACKAGE FRAMES NO FRAMES |
This file contains all the changes in documentation in the packagejava.rmi.activation
as colored differences. Deletions are shownlike this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.
TheClass Activatable, constructor Activatable(ActivationID, int)Activatable
class provides support for remote objects that require persistent access over time and that can be activated by the system. @author Ann Wollrath @version 1.20 0926 02/1102/9800 @sinceJDK11.2
Constructor used to activate/export the object on a specified port. An "activatable" remote object must have a constructor that takes two arguments:Class Activatable, constructor Activatable(ActivationID, int, RMIClientSocketFactory, RMIServerSocketFactory)
- the object's activation identifier (
ActivationID
) and- the object's initialization data (a
MarshalledObject
).A concrete subclass of this class must call this constructor when it is activated via the two parameter constructor described above. As a side-effect of construction the remote object is "exported" to the RMI runtime (on the specified
port
) and is available to accept incoming calls from clients. @param id activation identifier for the object @param port the port number on which the object is exported @exception RemoteException if exporting the object to the RMI runtime fails @sinceJDK11.2
Constructor used to activate/export the object on a specified port. An "activatable" remote object must have a constructor that takes two arguments:Class Activatable, constructor Activatable(String, MarshalledObject, boolean, int)
- the object's activation identifier (
ActivationID
) and- the object's initialization data (a
MarshalledObject
).A concrete subclass of this class must call this constructor when it is activated via the two parameter constructor described above. As a side-effect of construction the remote object is "exported" to the RMI runtime (on the specified
port
) and is available to accept incoming calls from clients. @param id activation identifier for the object @param port the port number on which the object is exported @param csf the client-side socket factory for making calls to the remote object @param ssf the server-side socket factory for receiving remote calls @exception RemoteException if exporting the object to the RMI runtime fails @sinceJDK11.2
Constructor used to register and export the object on a specified port (an anonymous port is chosen if port=0) . A concrete subclass of this class must call this constructor to register and export the object during initial construction. As a side-effect of activatable object construction the remote object is both "registered" with the activation system and "exported" (on an anonymous port if port=0) to the RMI runtime so that it is available to accept incoming calls from clients. @param location the location for classes for this object @param data the object's initialization data @param port the port on which the object is exported (an anonymous port is used if port=0) @param restart if true the object is restarted (reactivated) when either the activator is restarted or the object's activation group is restarted after an unexpected crash; if false the object is only activated on demand. SpecifyingClass Activatable, constructor Activatable(String, MarshalledObject, boolean, int, RMIClientSocketFactory, RMIServerSocketFactory)restart
to betrue
does not force an initial immediate activation of a newly registered object; initial activation is lazy. @exception ActivationException if object registration fails. @exception RemoteException if either of the following fails: a) registering the object with the activation system or b) exporting the object to the RMI runtime. @sinceJDK11.2
Constructor used to register and export the object on a specified port (an anonymous port is chosen if port=0) .Class Activatable, Remote exportObject(Remote, ActivationID, int)A concrete subclass of this class must call this constructor to register and export the object during initial construction. As a side-effect of activatable object construction the remote object is both "registered" with the activation system and "exported" (on an anonymous port if port=0) to the RMI runtime so that it is available to accept incoming calls from clients.
Note that objects created via this constructor will be activated on demand not restarted when the activation daemon starts. If an activatable objects requires restart when the activation daemon rmid starts use the second Activatable constructor form.@param location the location for classes for this object @param data the object's initialization data @param restart if true the object is restarted (reactivated) when either the activator is restarted or the object's activation group is restarted after an unexpected crash; if false the object is only activated on demand. Specifyingrestart
to betrue
does not force an initial immediate activation of a newly registered object; initial activation is lazy. @param port the port on which the object is exported (an anonymous port is used if port=0) @param csf the client-side socket factory for making calls to the remote object @param ssf the server-side socket factory for receiving remote calls @exception ActivationException if object registration fails. @exception RemoteException if either of the following fails: a) registering the object with the activation system or b) exporting the object to the RMI runtime. @sinceJDK11.2
Export the activatable remote object to the RMI runtime to make the object available to receive incoming calls. The object is exported on an anonymous port ifClass Activatable, Remote exportObject(Remote, ActivationID, int, RMIClientSocketFactory, RMIServerSocketFactory)port
is zero.During activation this
exportObject
method should be invoked explicitly by an "activatable" object that does not extend theActivatable
class. There is no need for objects that do extend theActivatable
class to invoke this method directly; this method is called by the second constructor above (which a subclass should invoke from its special activation constructor). @return the stub for the activatable remote object @param obj the remote object implementation @param id the object's activation identifier @param port the port on which the object is exported (an anonymous port is used if port=0) @exception RemoteException if object export fails @sinceJDK11.2
Export the activatable remote object to the RMI runtime to make the object available to receive incoming calls. The object is exported on an anonymous port ifClass Activatable, ActivationID exportObject(Remote, String, MarshalledObject, boolean, int)port
is zero.During activation this
exportObject
method should be invoked explicitly by an "activatable" object that does not extend theActivatable
class. There is no need for objects that do extend theActivatable
class to invoke this method directly; this method is called by the second constructor above (which a subclass should invoke from its special activation constructor). @return the stub for the activatable remote object @param obj the remote object implementation @param id the object's activation identifier @param port the port on which the object is exported (an anonymous port is used if port=0) @param csf the client-side socket factory for making calls to the remote object @param ssf the server-side socket factory for receiving remote calls @exception RemoteException if object export fails @sinceJDK11.2
ThisClass Activatable, ActivationID exportObject(Remote, String, MarshalledObject, boolean, int, RMIClientSocketFactory, RMIServerSocketFactory)exportObject
method may be invoked explicitly by an "activatable" object that does not extend theActivatable
class in order to both a) register the object's activation descriptor constructed from the suppliedlocation
anddata
with the activation system (so the object can be activated) and b) export the remote objectobj
on a specific port (if port=0 then an anonymous port is chosen). Once the object is exported it can receive incoming RMI calls.This method does not need to be called if
obj
extendsActivatable
since the first constructor calls this method. @param obj the object being exported @param location the object's code location @param data the object's bootstrapping data @param restart if true the object is restarted (reactivated) when either the activator is restarted or the object's activation group is restarted after an unexpected crash; if false the object is only activated on demand. Specifyingrestart
to betrue
does not force an initial immediate activation of a newly registered object; initial activation is lazy. @param port the port on which the object is exported (an anonymous port is used if port=0) @returnsreturn the activation identifier obtained from registering the descriptordesc
with the activation system the wrong group @exception ActivationException if activation group is not active @exception RemoteException if object registration or export fails @sinceJDK11.2
ThisClass Activatable, ActivationID getID()exportObject
method may be invoked explicitly by an "activatable" object that does not extend theActivatable
class in order to both a) register the object's activation descriptor constructed from the suppliedlocation
anddata
with the activation system (so the object can be activated) and b) export the remote objectobj
on a specific port (if port=0 then an anonymous port is chosen). Once the object is exported it can receive incoming RMI calls.This method does not need to be called if
obj
extendsActivatable
since the first constructor calls this method. @param obj the object being exported @param location the object's code location @param data the object's bootstrapping data @param restart if true the object is restarted (reactivated) when either the activator is restarted or the object's activation group is restarted after an unexpected crash; if false the object is only activated on demand. Specifyingrestart
to betrue
does not force an initial immediate activation of a newly registered object; initial activation is lazy. @param port the port on which the object is exported (an anonymous port is used if port=0) @param csf the client-side socket factory for making calls to the remote object @param ssf the server-side socket factory for receiving remote calls @return the activation identifier obtained from registering the descriptordesc
with the activation system the wrong group @exception ActivationException if activation group is not active @exception RemoteException if object registration or export fails @sinceJDK11.2
Returns the object's activation identifier. The method is protected so that only subclasses can obtain an object's identifier. @return the object's activation identifier @sinceClass Activatable, boolean inactive(ActivationID)JDK11.2
Informs the system that the object with the corresponding activationClass Activatable, Remote register(ActivationDesc)id
is currently inactive. If the object is currently active the object is "unexported" from the RMI runtime (only if there are no pending or in-progress calls) so the that it can no longer receive incoming calls. This call informs this VM's ActivationGroup that the object is inactive that in turn informs its ActivationMonitor. If this call completes successfully a subsequent activate request to the activator will cause the object to reactivate. The operation may still succeed if the object is considered active but has already unexported itself. @param id the object's activation identifier @returnsreturn true if the operation succeeds (the operation will succeed if the object in currently known to be active and is either already unexported or is currently exported and has no pending/executing calls); false is returned if the object has pending/executing calls in which case it cannot be deactivated @exception UnknownObjectException if object is not known (it may already be inactive) @exception ActivationException if group is not active @exception RemoteException if call informing monitor fails @sinceJDK11.2
Register an object descriptor for an activatable remote object so that is can be activated on demand. @param desc the object's descriptor @return the stub for the activatable remote object @exception UnknownGroupException if group id inClass Activatable, boolean unexportObject(Remote, boolean)desc
is not registered with the activation system @exception ActivationException if activation system is not running @exception RemoteException if remote call fails @sinceJDK11.2
Remove the remote object obj from the RMI runtime. If successful the object can no longer accept incoming RMI calls. If the force parameter is true the object is forcibly unexported even if there are pending calls to the remote object or the remote object still has calls in progress. If the force parameter is false the object is only unexported if there are no pending or in progress calls to the object. @param obj the remote object to be unexported @param force if true unexports the object even if there are pending or in-progress calls; if false only unexports the object if there are no pending or in-progress calls @return true if operation is successful false otherwise @exception NoSuchObjectException if the remote object is not currently exported @sinceClass Activatable, void unregister(ActivationID)JDK11.2
Revokes previous registration for the activation descriptor associated withid
. An object can no longer be activated via thatid
. @param id the object's activation identifier @exception UnknownObjectException if object (id
) is unknown @exception ActivationException if activation system is not running @exception RemoteException if remote call to activation system fails @sinceJDK11.2
This exception is thrown by the RMI runtime when activation fails during a remote call to an activatable object. @author Ann Wollrath @version 1.Class ActivateFailedException, constructor ActivateFailedException(String)3 077 02/0802/9800 @sinceJDK11.2
Constructs anClass ActivateFailedException, constructor ActivateFailedException(String, Exception)ActivateFailedException
with the specified detail message. @param s the detail message @sinceJDK11.2
Constructs anActivateFailedException
with the specified detail message and nested exception. @param s the detail message @param ex the nested exception @sinceJDK11.2
An activation descriptor contains the information necessary to activate an object:Class ActivationDesc, constructor ActivationDesc(ActivationGroupID, String, String, MarshalledObject)
- the object's group identifier
- the object's fully-qualified class name
- the object's code location (the location of the class) a codebase URL path
- the object's restart "mode"
and- a "marshalled" object that can contain object specific initialization data.
A descriptor registered with the activation system can be used to recreate/activate the object specified by the descriptor. TheMarshalledObject
in the object's descriptor is passed as the second argument to the remote object's constructor for object to use during reinitialization/activation. @author Ann Wollrath @version 1.19 0824 02/1002/9800 @sinceJDK11.2 @see java.rmi.activation.Activatable
Constructs an object descriptor for an object whose class name isClass ActivationDesc, constructor ActivationDesc(ActivationGroupID, String, String, MarshalledObject, boolean)className
that can be loaded from the codelocation
and whose initialization information isdata
. All objects with the samegroupID
are activated in the same Java VM.Note that objects specified by a descriptor created with this constructor will only be activated on demand (by default the restart mode is
false
). If an activatable object requires restart services use one of theActivationDesc
constructors that takes a boolean parameterrestart
. @param groupID the group's identifier (obtained from registeringActivationSystem.registerGroup
method). The group indicates the VM in which the object should be activated. @param className the object's fully package-qualified class name @param location the object's code location (from where the class is loaded) @param data the object's initialization (activation) data contained in marshalled form. @exception IllegalArgumentException ifgroupID
is null @sinceJDK11.2
Constructs an object descriptor for an object whose class name isClass ActivationDesc, constructor ActivationDesc(String, String, MarshalledObject)className
that can be loaded from the codelocation
and whose initialization information isdata
. All objects with the samegroupID
are activated in the same Java VM. @param groupID the group's identifier (obtained from registeringActivationSystem.registerGroup
method). The group indicates the VM in which the object should be activated. @param className the object's fully package-qualified class name @param location the object's code location (from where the class is loaded) @param data the object's initialization (activation) data contained in marshalled form. @param restart if true the object is restarted (reactivated) when either the activator is restarted or the object's activation group is restarted after an unexpected crash; if false the object is only activated on demand. Specifyingrestart
to betrue
does not force an initial immediate activation of a newly registered object; initial activation is lazy. @exception IllegalArgumentException ifgroupID
is null @sinceJDK11.2
Constructs an object descriptor for an object whose class name isClass ActivationDesc, constructor ActivationDesc(String, String, MarshalledObject, boolean)className
that can be loaded from the codelocation
and whose initialization information isdata
. If this form of the constructor is used thegroupID
defaults to the current id forActivationGroup
for this VM. All objects with the sameActivationGroupID
are activated in the same VM.ObjectsNote that objects specified by a descriptor created
bywith this constructor willnotonlyrestart automatically when thebe activated on demandRMI(byactivation daemon starts but willdefault the restart mode isbefalse
).activated on demandIf an activatable(viaobjecta method callrequires restart servicestouse one of theactivatableActivationDesc
object)constructors that takes a boolean parameterrestart
.This constructor will throw
ActivationException
if there is no current activation group for this VM. To create anActivationGroup
use theActivationGroup.createGroup
method. @param className the object's fully package qualified class name @param location the object's code location (from where the class is loaded) @param data the object's initialization (activation) data contained in marshalled form. @exception ActivationException if the current group is nonexistent @sinceJDK11.2
Constructs an object descriptor for an object whose class name isClass ActivationDesc, boolean equals(Object)className
that can be loaded from the codelocation
and whose initialization information isdata
. If this form of the constructor is used thegroupID
defaults to the current id forActivationGroup
for this VM. All objects with the sameActivationGroupID
are activated in the same VM.This constructor will throw
ActivationException
if there is no current activation group for this VM. To create anActivationGroup
use theActivationGroup.createGroup
method. @param className the object's fully package qualified class name @param location the object's code location (from where the class is loaded) @param data the object's initialization (activation) data contained in marshalled form. @param restart if true the object is restarted (reactivated) when either the activator is restarted or the object's activation group is restarted after an unexpected crash; if false the object is only activated on demand. Specifyingrestart
to betrue
does not force an initial immediate activation of a newly registered object; initial activation is lazy. @exception ActivationException if the current group is nonexistent @sinceJDK11.2
Compares two activation descriptors for content equality. @param obj the Object to compare with @return true if these Objects are equal; false otherwise. @see java.util.Hashtable @sinceClass ActivationDesc, String getClassName()JDK11.2
Returns the class name for the object specified by this descriptor. @return the class name @sinceClass ActivationDesc, MarshalledObject getData()JDK11.2
Returns a "marshalled object" containing intialization/activation data for the object specified by this descriptor. @return the object specific "initialization" data @sinceClass ActivationDesc, ActivationGroupID getGroupID()JDK11.2
Returns the group identifier for the object specified by this descriptor. A group provides a way to aggregate objects into a single Java virtual machine. RMI creates/activates objects with the sameClass ActivationDesc, String getLocation()groupID
in the same virtual machine. @return the group identifier @sinceJDK11.2
Returns the code location for the object specified by this descriptor. @return the code location @sinceClass ActivationDesc, boolean getRestartMode()JDK11.2
Returns the "restart" mode of the object associated with this activation descriptor. @return true if the activatable object associated with this activation descriptorshould beis restarted via the activation daemon when either the daemon comes up or the object's group is restarted after an unexpected crash; otherwise it returns false(meaning that the object is only activated on demand via a method call). Note that if the restart mode istrue
the activator does not force an initial immediate activation of a newly registered object; initial activation is lazy. @sinceJDK11.2
General exception used by the activation interfaces. @author Ann Wollrath @version 1.Class ActivationException, constructor ActivationException()14 0719 02/0802/9800 @sinceJDK11.2
Constructs anClass ActivationException, constructor ActivationException(String)ActivationException
with no specified detail message. @sinceJDK11.2
Constructs anClass ActivationException, constructor ActivationException(String, Throwable)ActivationException
with detail messages
. @param s the detail message @sinceJDK11.2
Constructs anClass ActivationException, String getMessage()ActivationException
with detail messages
and detail exceptionex
. @param s detail message @param ex detail exception @sinceJDK11.2
Produces the message include the message from the nested exception if there is one. @return the message @sinceClass ActivationException, void printStackTrace()JDK11.2
Prints the composite message toClass ActivationException, void printStackTrace(PrintStream)System.err
. @sinceJDK11.2
Prints the composite message and the embedded stack trace to the specified streamClass ActivationException, void printStackTrace(PrintWriter)ps
. @param ps the print stream @sinceJDK11.2
Prints the composite message and the embedded stack trace to the specified print writerpw
. @param pw the print writer @sinceJDK11.2
AnClass ActivationGroup, constructor ActivationGroup(ActivationGroupID)ActivationGroup
is responsible for creating new instances of "activatable" objects in its group informing itsActivationMonitor
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:
- as a side-effect of creating an
ActivationDesc
(using its first constructor) for the first activatable object in the group or- via the
ActivationGroup.createGroup
method- as a side-effect of activating the first object in a group whose
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 theActivationGroup.createGroup
static method. ThecreateGroup
method has two requirements on the group to be created: 1) the group must be a concrete subclass ofActivationGroup
and 2) the group must have a constructor that takes two arguments:
- the group's
ActivationGroupID
and- the group's initialization data (in a
java.rmi.MarshalledObject
)When created the default implementation of
ActivationGroup
will override the system properties with the properties requested when itsActivationGroupDesc
was created and will set ajava.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 specialProperties
object containing these properties then create anActivationGroupDesc
with theProperties
object and useActivationGroup.createGroup
before creating anyActivationDesc
s (before the defaultActivationGroupDesc
is created). If your application requires the use of a security manager other thanjava.rmi.RMISecurityManager
in the ActivativationGroupDescriptor properties list you can setjava.security.manager
property to the name of the security manager you would like to install. @author Ann Wollrath @version 1.27330402/2202/9900 @see ActivationInstantiator @see ActivationGroupDesc @see ActivationGroupID @sinceJDK11.2
Constructs and exports an activation group as a UnicastRemoteObject so that a client can invoke its newInstance method. @param groupID the group's identifier @exception RemoteException if group could not be exported @sinceClass ActivationGroup, void activeObject(ActivationID, MarshalledObject)JDK11.2
This protected method is necessary for subclasses to make theClass ActivationGroup, void activeObject(ActivationID, Remote)activeObject
callback to the group's monitor. The call is simply forwarded to the group'sActivationMonitor
. @param id the object's identifier @param mobj a marshalled object containing the remote object's stub @exception UnknownObjectException if object is not registered @exception RemoteException if call informing monitor fails @exception ActivationException if an activation error occurs @sinceJDK11.2
The group'sClass ActivationGroup, ActivationGroup createGroup(ActivationGroupID, ActivationGroupDesc, long)activeObject
method is called when an object is exported (either byActivatable
object construction or an explicit call toActivatable.exportObject
. The group must inform itsActivationMonitor
that the object is active (via the monitor'sactiveObject
method) if the group hasn't already done so. @param id the object's identifier @param obj the remote object implementation @exception UnknownObjectException if object is not registered @exception RemoteException if call informing monitor fails @exception ActivationException if group is inactive @sinceJDK11.2
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 theClass ActivationGroup, ActivationGroupID currentGroupID()createGroup
method when theActivator
initiates the re-creation of an activation group in order to carry out incomingactivate
requests. A group must first be registered with theActivationSystem
before it can be created via this method.If there is a security manager this method first calls the security manager's checkSetFactory method. This could result in a SecurityException.The group class specified by the
ActivationGroupDesc
must be a concrete subclass ofActivationGroup
and have a public constructor that takes two arguments: theActivationGroupID
for the group and theMarshalledObject
containing the group's initialization data (obtained from theActivationGroupDesc
.If the group class name specified in the
ActivationGroupDesc
isnull
then this method will behave as if the group descriptor contained the name of the default activation group implementation class. Note:Ifthat 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 aSecurityException
. If your application needs to set a different security manager you must ensure that the policy file specified by the group'sActivationGroupDesc
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 theactiveGroup
method which returns theActivationMonitor
for the group. The application need not callactiveGroup
independently since it is taken care of by this method.
Once a group is created subsequent calls to thecurrentGroupID
method will return the identifier for this group until the group becomes inactive. @param id the activation group's identifier @param desc the activation group's descriptor @param incarnation the group's incarnation number (zero on group's initial creation) @return the activation group for the VM @exception ActivationException if group already exists or if error occurs during group creation @exception SecurityException if permission to create group is denied. (Note: The default implementation of the security managercheckSetFactory
method requires the RuntimePermission "setFactory") @see SecurityManager#checkSetFactory @sinceJDK11.2
Returns the current activation group's identifier. Returns null if no group is currently active for this VM. @return the activation group's identifier @sinceClass ActivationGroup, ActivationSystem getSystem()JDK11.2
Returns the activation system for the VM. The activation system may be set by theClass ActivationGroup, void inactiveGroup()setSystem
method. If the activation system is not set via thesetSystem
method then thegetSystem
method attempts to obtain a reference to theActivationSystem
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 byActivationSystem.SYSTEM_PORT
. This port can be overridden by setting the propertyjava.rmi.activation.port
. @return the activation system for the VM/group @exception ActivationException if activation system cannot be obtained or is not bound (means that it is not running) @sinceJDK11.2
This protected method is necessary for subclasses to make theClass ActivationGroup, boolean inactiveObject(ActivationID)inactiveGroup
callback to the group's monitor. The call is simply forwarded to the group'sActivationMonitor
. Also the current group for the VM is set to null. @exception UnknownGroupException if group is not registered @exception RemoteException if call informing monitor fails @sinceJDK11.2
The group'sClass ActivationGroup, void setSystem(ActivationSystem)inactiveObject
method is called indirectly via a call to theActivatable.inactive
method. A remote object implementation must callActivatable
'sinactive
method when that object deactivates (the object deems that it is no longer active). If the object does not callActivatable.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 ofActivationGroup
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'sinactiveObject
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.
@param id the object's activation identifier @return true if the object was successfully deactivated; otherwise returns false. @exception UnknownObjectException if object is unknown (may already be inactive) @exception RemoteException if call informing monitor fails @exception ActivationException if group is inactive @since
JDK11.2
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 thegetSystem
method attempts to obtain a reference to theActivationSystem
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 byActivationSystem.SYSTEM_PORT
. This port can be overridden by setting the propertyjava.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. @param system remote reference to theActivationSystem
@exception ActivationException if activation system is already set @exception SecurityException if permission to set the activation system is denied. (Note: The default implementation of the security managercheckSetFactory
method requires the RuntimePermission "setFactory") @see SecurityManager#checkSetFactory @sinceJDK11.2
An activation group descriptor contains the information necessary to create/recreate an activation group in which to activate objects. Such a descriptor contains:
- the group's class name
- the group's code location (the location of the group's class) and
- a "marshalled" object that can contain group specific initialization data.
The group's class must be a concrete subclass of
ActivationGroup
. A subclass ofActivationGroup
is created/recreated via theActivationGroup.createGroup
static method that invokes a special constructor that takes two arguments:
- the group's
ActivationGroupID
and- the group's initialization data (in a
java.rmi.MarshalledObject
)@version 1.
17 1024 02/1702/9800 @author Ann Wollrath @sinceJDK11.2 @see ActivationGroup @see ActivationGroupID
Startup options for ActivationGroup implementations. This class allows overriding default system properties and specifying implementation-defined options for ActivationGroups. @sinceClass ActivationGroupDesc.CommandEnvironment, constructor ActivationGroupDesc.CommandEnvironment(String, String[])JDK11.2
Create a CommandEnvironment with all the necessary information. @param cmdpath the name of the java executable including the full path orClass ActivationGroupDesc.CommandEnvironment, boolean equals(Object)null
meaning "use rmid's default". The named program must be able to accept multiple-Dpropname=value
options (as documented for the "java" tool) @param argv extra options which will be used in creating the ActivationGroup. Null has the same effect as an empty list. @sinceJDK11.2
Compares two command environments for content equality. @param obj the Object to compare with @return true if these Objects are equal; false otherwise. @see java.util.Hashtable @sinceClass ActivationGroupDesc.CommandEnvironment, String[] getCommandOptions()JDK11.2
Fetch the configured java command options. @return An array of the command options which will be passed to the new child command by rmid. Note that rmid may add other options before or after these options or both. Never returnsClass ActivationGroupDesc.CommandEnvironment, String getCommandPath()null
. @sinceJDK11.2
Fetch the configured path-qualified java command name. @return the configured name orClass ActivationGroupDesc.CommandEnvironment, int hashCode()null
if configured to accept the default @sinceJDK11.2
Return identical values for similar CommandEnvironment
s. @return an integer @see java.util.Hashtable
Constructs a group descriptor that uses the systemClass ActivationGroupDesc, constructor ActivationGroupDesc(String, String, MarshalledObject, Properties, CommandEnvironment)defaultdefaults for group implementation and code location. Properties specify Java environment overrides (which will override system properties in the group implementation's VM). The command environment can control the exact command/options used in starting the child VM or can benull
to accept rmid's default.This constructor will create an
ActivationGroupDesc
with anull
group class name which indicates the system's defaultActivationGroup
implementation. @parampropertiesoverrides the set of properties to set when the group is recreated. @param cmd the controlling options for executing the VM in another process (ornull
). @sinceJDK11.2
Specifies an alternate group implementation and execution environment to be used for the group. @param className the group'sClass ActivationGroupDesc, boolean equals(Object)fullypackage qualifiedclassNameclass name ornull
. Anull
group class name indicates the system's defaultActivationGroup
implementation. @param location the location from where to load the group's class @param data the group's initialization data contained in marshalled form (could contain properties for example) @param overrides a properties map which will override those set by default in the subprocess environment (will be translated into-D
options) ornull
. @param cmd the controlling options for executing the VM in another process (ornull
). @sinceJDK11.2
Compares two activation group descriptors for content equality. @param obj the Object to compare with @return true if these Objects are equal; false otherwise. @see java.util.Hashtable @sinceClass ActivationGroupDesc, String getClassName()JDK11.2
Returns the group's class name (possiblyClass ActivationGroupDesc, CommandEnvironment getCommandEnvironment()null
). Anull
group class name indicates the system's defaultActivationGroup
implementation. @return the group's class name @sinceJDK11.2
Returns the group's command-environment control object. @return the command-environment object orClass ActivationGroupDesc, MarshalledObject getData()null
@sinceJDK11.2
Returns the group's initialization data. @return the group's initialization data @sinceClass ActivationGroupDesc, String getLocation()JDK11.2
Returns the group's code location. @return the group's code location @sinceClass ActivationGroupDesc, Properties getPropertyOverrides()JDK11.2
Returns the group's property-override list. @return the property-override list ornull
@sinceJDK11.2
The identifier for a registered activation group serves several purposes:Class ActivationGroupID, constructor ActivationGroupID(ActivationSystem)
- identifies the group uniquely within the activation system and
- contains a reference to the group's activation system so that the group can contact its activation system when necessary.
The
ActivationGroupID
is returned from the call toActivationSystem.registerGroup
and is used to identify the group within the activation system. This group id is passed as one of the arguments to the activation group's special constructor when an activation group is created/recreated. @author Ann Wollrath @version 1.8 0712 02/0802/9800 @see ActivationGroup @see ActivationGroupDesc @sinceJDK11.2
Constructs a unique group id. @param system the group's activation system @sinceClass ActivationGroupID, boolean equals(Object)JDK11.2
Compares two group identifiers for content equality. Returns true if both of the following conditions are true: 1) the unique identifiers are equivalent (by content) and 2) the activation system specified in each refers to the same remote object. @param obj the Object to compare with @return true if these Objects are equal; false otherwise. @see java.util.Hashtable @sinceClass ActivationGroupID, ActivationSystem getSystem()JDK11.2
Returns the group's activation system. @return the group's activation system @sinceClass ActivationGroupID, int hashCode()JDK11.2
Returns a hashcode for the group's identifier. Two group identifiers that refer to the same remote group will have the same hash code. @see java.util.Hashtable @sinceJDK11.2
Activation makes use of special identifiers to denote remote objects that can be activated over time. An activation identifier (an instance of the classClass ActivationID, constructor ActivationID(Activator)ActivationID
) contains several pieces of information needed for activating an object:
- a remote reference to the object's activator and
- a unique identifier for the object.
An activation id for an object can be obtained by registering an object with the activation system. Registration is accomplished in a few ways:
@author Ann Wollrath @version 1.
- via the
Activatable.register
method- via the first
Activatable
constructor (that takes three arguments and both registers and exports the object and- via the first
Activatable.exportObject
method that takes the activation descriptor object and port as arguments; this method both registers and exports the object.15 0719 02/0802/9800 @see Activatable @sinceJDK11.2
The constructor forClass ActivationID, Remote activate(boolean)ActivationID
takes a single argument activator that specifies a remote reference to the activator responsible for activating the object associated with this identifier. An instance ofActivationID
is globally unique. @param activator reference to the activator responsible for activating the object @sinceJDK11.2
Activate the object for this id. @param force if true forces the activator to contact the group when activating the object (instead of returning a cached reference); if false returning a cached value is acceptable. @return the reference to the active remote object @exception ActivationException if activation fails @exception UnknownObjectException if the object is unknown @exception RemoteException if remote call fails @sinceClass ActivationID, boolean equals(Object)JDK11.2
Compares two activation ids for content equality. Returns true if both of the following conditions are true: 1) the unique identifiers equivalent (by content) and 2) the activator specified in each identifier refers to the same remote object. @param obj the Object to compare with @return true if these Objects are equal; false otherwise. @see java.util.Hashtable @sinceClass ActivationID, int hashCode()JDK11.2
Returns a hashcode for the activation id. Two identifiers that refer to the same remote object will have the same hash code. @see java.util.Hashtable @sinceJDK11.2
AnClass ActivationInstantiator, MarshalledObject newInstance(ActivationID, ActivationDesc)ActivationInstantiator
is responsible for creating instances of "activatable" objects. A concrete subclass ofActivationGroup
implements thenewInstance
method to handle creating objects within the group. @author Ann Wollrath @version 1.7 0711 02/0802/9800 @see ActivationGroup @sinceJDK11.2
The activator calls an instantiator'snewInstance
method in order to recreate in that group an object with the activation identifierid
and descriptordesc
. The instantiator is responsible for:
- determining the class for the object using the descriptor's
getClassName
method- loading the class from the code location obtained from the descriptor (using the
getLocation
method)- creating an instance of the class by invoking the special "activation" constructor of the object's class that takes two arguments: the object's
ActivationID
and theMarshalledObject
containing object specific initialization data and- returning a MarshalledObject containing the stub for the remote object it created
@param id the object's activation identifier @param desc the object's descriptor @return a marshalled object containing the serialized representation of remote object's stub @exception ActivationException if object activation fails @exception RemoteException if remote call fails @since
JDK11.2
AnClass ActivationMonitor, void activeObject(ActivationID, MarshalledObject)ActivationMonitor
is specific to anActivationGroup
and is obtained when a group is reported active via a call toActivationSystem.activeGroup
(this is done internally). An activation group is responsible for informing itsActivationMonitor
when either: its objects become active or inactive or the group as a whole becomes inactive. @author Ann Wollrath @version 1.8 0712 02/1202/9800 @see Activator @see ActivationSystem @see ActivationGroup @sinceJDK11.2
Informs that an object is now active. AnClass ActivationMonitor, void inactiveGroup(ActivationGroupID, long)ActivationGroup
informs its monitor if an object in its group becomes active by other means than being activated directly (i.e. the object is registered and "activated" itself). @param id the active object's id @param obj the marshalled form of the object's stub @exception UnknownObjectException if object is unknown @exception RemoteException if remote call fails @sinceJDK11.2
Informs that the group is now inactive. The group will be recreated upon a subsequent request to activate an object within the group. A group becomes inactive when all objects in the group report that they are inactive. @param id the group's id @param incarnation the group's incarnation number @exception UnknownGroupException if group is unknown @exception RemoteException if remote call fails @sinceClass ActivationMonitor, void inactiveObject(ActivationID)JDK11.2
An activation group calls its monitor'sinactiveObject
method when an object in its group becomes inactive (deactivates). An activation group discovers that an object (that it participated in activating) in its VM is no longer active via calls to the activation group'sinactiveObject
method.The
inactiveObject
call informs theActivationMonitor
that the remote object reference it holds for the object with the activation identifierid
is no longer valid. The monitor considers the reference associated withid
as a stale reference. Since the reference is considered stale a subsequentactivate
call for the same activation identifier results in re-activating the remote object.@param id the object's activation identifier @exception UnknownObjectException if object is unknown @exception RemoteException if remote call fails @since
JDK11.2
TheClass ActivationSystem, ActivationMonitor activeGroup(ActivationGroupID, ActivationInstantiator, long)ActivationSystem
provides a means for registering groups and "activatable" objects to be activated within those groups. TheActivationSystem
works closely with theActivator
which activates objects registered via theActivationSystem
and theActivationMonitor
which obtains information about active and inactive objects and inactive groups. @author Ann Wollrath @version 1.8 0713 02/0802/9800 @see Activator @see ActivationMonitor @sinceJDK11.2
Callback to inform activation system that group is now active. This call is made internally by theClass ActivationSystem, ActivationDesc getActivationDesc(ActivationID)ActivationGroup.createGroup
method to inform theActivationSystem
that the group is now active. @param id the activation group's identifier @param group the group's instantiator @param incarnation the group's incarnation number @return monitor for activation group @exception UnknownGroupException if group is not registered @exception ActivationException if group is already active @exception RemoteException if remote call fails @sinceJDK11.2
Returns the activation descriptor for the object with the activation identifierClass ActivationSystem, ActivationGroupDesc getActivationGroupDesc(ActivationGroupID)id
. @param id the activation identifier for the activatable object @exception UnknownObjectException ifid
is not registered @exception ActivationException for general failure @exception RemoteException if remote call fails @return the activation descriptor @sinceJDK11.2
Returns the activation group descriptor for the group with the activation group identifierClass ActivationSystem, ActivationGroupID registerGroup(ActivationGroupDesc)id
. @param id the activation group identifier for the group @exception UnknownGroupException ifid
is not registered @exception ActivationException for general failure @exception RemoteException if remote call fails @return the activation group descriptor @sinceJDK11.2
Register the activation group. An activation group must be registered with theClass ActivationSystem, ActivationID registerObject(ActivationDesc)ActivationSystem
before objects can be registered within that group. @param desc the group's descriptor @return an identifier for the group @exception ActivationException if group registration fails @exception RemoteException if remote call fails @sinceJDK11.2
TheClass ActivationSystem, ActivationDesc setActivationDesc(ActivationID, ActivationDesc)registerObject
method is used to register an activation descriptordesc
and obtain an activation identifier for a activatable remote object. TheActivationSystem
creates anActivationID
(a activation identifier) for the object specified by the descriptordesc
and records in stable storage the activation descriptor and its associated identifier for later use. When theActivator
receives anactivate
request for a specific identifier it looks up the activation descriptor (registered previously) for the specified identifier and uses that information to activate the object.@param desc the object's activation descriptor @return the activation id that can be used to activate the object @exception ActivationException if registration fails (e.g. database update failure etc). @exception UnknownGroupException if group referred to in
desc
is not registered with this system @exception RemoteException if remote call fails @sinceJDK11.2
Set the activation descriptorClass ActivationSystem, ActivationGroupDesc setActivationGroupDesc(ActivationGroupID, ActivationGroupDesc)desc
for the object with the activation identifierid
. The change will take effect upon subsequent activation of the object. @param id the activation identifier for the activatable object @param desc the activation descriptor for the activatable object @exception UnknownGroupException the group associated withdesc
is not a registered group @exception UnknownObjectException the activationid
is not registered @exception ActivationException for general failure (e.g. unable to update log) @exception RemoteException if remote call fails @return the previous value of the activation descriptor @sinceJDK11.2
Set the activation group descriptorClass ActivationSystem, void shutdown()desc
for the object with the activation group identifierid
. The change will take effect upon subsequent activation of the group. @param id the activation group identifier for the activation group @param desc the activation group descriptor for the activation group @exception UnknownGroupException the group associated withid
is not a registered group @exception ActivationException for general failure (e.g. unable to update log) @exception RemoteException if remote call fails @return the previous value of the activation group descriptor @sinceJDK11.2
Shutdown the activation system. Destroys all groups spawned by the activation daemon and exits the activation daemon. @exception RemoteException if failed to contact/shutdown the activation daemon @sinceClass ActivationSystem, void unregisterGroup(ActivationGroupID)JDK11.2
Remove the activation group. An activation group makes this call back to inform the activator that the group should be removed (destroyed). If this call completes successfully objects can no longer be registered or activated within the group. All information of the group and its associated objects is removed from the system. @param id the activation group's identifier @exception ActivationException if unregister fails (e.g. database update failure etc). @exception UnknownGroupException if group is not registered @exception RemoteException if remote call fails @sinceClass ActivationSystem, void unregisterObject(ActivationID)JDK11.2
Remove the activation id and associated descriptor previously registered with theClass ActivationSystem, int SYSTEM_PORTActivationSystem
; the object can no longer be activated via the object's activation id. @param id the object's activation id (from previous registration) @exception ActivationException if unregister fails (e.g. database update failure etc). @exception UnknownObjectException if object is unknown (not registered) @exception RemoteException if remote call fails @sinceJDK11.2
The port to lookup the activation system.
TheClass Activator, MarshalledObject activate(ActivationID, boolean)Activator
facilitates remote object activation. A "faulting" remote reference calls the activator'sactivate
method to obtain a "live" reference to a "activatable" remote object. Upon receiving a request for activation the activator looks up the activation descriptor for the activation identifierid
determines the group in which the object should be activated initiates object re-creation via the group'sActivationInstantiator
(via a call to thenewInstance
method). The activator initiates the execution of activation groups as necessary. For example if an activation group for a specific group identifier is not already executing the activator initiates the execution of a VM for the group.The
Activator
works closely withActivationSystem
which provides a means for registering groups and objects within those groups andActivationMonitor
which recives information about active and inactive objects and inactive groups.The activator is responsible for monitoring and detecting when activation groups fail so that it can remove stale remote references to groups and active object's within those groups.
@author Ann Wollrath @version 1.
11 0915 02/2102/9800 @see ActivationInstantiator @see ActivationGroupDesc @see ActivationGroupID @sinceJDK11.2
Activate the object associated with the activation identifierid
. If the activator knows the object to be active already andforce
is false the stub with a "live" reference is returned immediately to the caller; otherwise if the activator does not know that corresponding the remote object is active the activator uses the activation descriptor information (previously registered) to determine the group (VM) in which the object should be activated. If anActivationInstantiator
corresponding to the object's group descriptor already exists the activator invokes the activation group'snewInstance
method passing it the object's id and descriptor.If the activation group for the object's group descriptor does not yet exist the activator starts an
ActivationInstantiator
executing (by spawning a child process for example). When the activator receives the activation group's call back (via theActivationSystem
'sactiveGroup
method) specifying the activation group's reference the activator can then invoke that activation instantiator'snewInstance
method to forward each pending activation request to the activation group and return the result (a marshalled remote object reference a stub) to the caller.Note that the activator receives a "marshalled" object instead of a Remote object so that the activator does not need to load the code for that object or participate in distributed garbage collection for that object. If the activator kept a strong reference to the remote object the activator would then prevent the object from being garbage collected under the normal distributed garbage collection mechanism.
@param id the activation identifier for the object being activated @param force if true the activator contacts the group to obtain the remote object's reference; if false returning the cached value is allowed. @return the remote object (a stub) in a marshalled form @exception ActivationException if object activation fails @exception UnknownObjectException if object is unknown (not registered) @exception RemoteException if remote call fails @since
JDK11.2
AnClass UnknownGroupException, constructor UnknownGroupException(String)UnknownGroupException
is thrown by methods of classes and interfaces in thejava.rmi.activation
package when theActivationGroupID
parameter to the method is determined to be invalid i.e. not known by theActivationSystem
. AnUnknownGroupException
is also thrown if theActivationGroupID
in anActivationDesc
refers to a group that is not registered with theActivationSystem
@version 1.6 0710 02/0802/9800 @author Ann Wollrath @sinceJDK11.2 @see java.rmi.activation.Activatable @see java.rmi.activation.ActivationGroup @see java.rmi.activation.ActivationGroupID @see java.rmi.activation.ActivationMonitor @see java.rmi.activation.ActivationSystem
Constructs anUnknownGroupException
with the specified detail message. @param s the detail message @sinceJDK11.2
AnClass UnknownObjectException, constructor UnknownObjectException(String)UnknownObjectException
is thrown by methods of classes and interfaces in thejava.rmi.activation
package when theActivationID
parameter to the method is determined to be invalid. AnActivationID
is invalid if it is not currently known by theActivationSystem
. AnActivationID
is obtained by theActivationSystem.registerObject
method. AnActivationID
is also obtained during theActivatable.register
call. @version 1.4 078 02/0802/9800 @author Ann Wollrath @sinceJDK11.2 @see java.rmi.activation.Activatable @see java.rmi.activation.ActivationGroup @see java.rmi.activation.ActivationID @see java.rmi.activation.ActivationMonitor @see java.rmi.activation.ActivationSystem @see java.rmi.activation.Activator
Constructs anUnknownObjectException
with the specified detail message. @param s the detail message @sinceJDK11.2