All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Class java.rmi.activation.Activatable

java.lang.Object
    |
    +----java.rmi.server.RemoteObject
            |
            +----java.rmi.server.RemoteServer
                    |
                    +----java.rmi.activation.Activatable

public abstract class Activatable
extends RemoteServer
The Activatable class provides support for remote objects that require persistent access over time and that can be activated by the system.

Since:
JDK1.2

Constructor Index

 o Activatable(ActivationID, int)
Constructor used to activate/export the object on a specified port.
 o Activatable(CodeSource, MarshalledObject, int)
Constructor used to register and export the object on a specified port (an anonymous port is chosen if port=0) .

Method Index

 o exportObject(Remote, ActivationID, int)
Export the activatable remote object to the RMI runtime to make the object available to receive incoming calls.
 o exportObject(Remote, CodeSource, MarshalledObject, int)
This exportObject method may be invoked explicitly by an "activatable" object, that does not extend the Activatable class, in order to both a) register the object's activation descriptor, constructed from the supplied source, and data, with the activation system (so the object can be activated), and b) export the remote object, obj, on a specific port (if port=0, then an anonymous port is chosen).
 o exportObject(Remote, String, Class[], Object[])
 o getID()
Returns the object's activation identifier.
 o inactive(ActivationID)
Informs the system that the object with the corresponding activation id is currently inactive.
 o register(ActivationDesc)
Register an object descriptor for an activatable remote object so that is can be activated on demand.
 o unregister(ActivationID)
Revokes previous registration for the activation descriptor associated with id.

Constructors

 o Activatable
protected Activatable(CodeSource source,
                      MarshalledObject data,
                      int port) throws ActivationException, RemoteException
Constructor used to register and export the object on a specified port (an anonymous port is chosen if port=0) . An "activatable" remote object must have a constructor that takes two arguments:

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.

Parameters:
source - the CodeSource for classes for this object
data - the object's initialization data
port - the port on which the object is exported (an anonymous port is used if port=0)
Throws: ActivationException
if object registration fails.
Throws: RemoteException
if either of the following fails: a) registering the object with the activation system or b) exporting the object to the RMI runtime.
 o Activatable
protected Activatable(ActivationID id,
                      int port) throws RemoteException
Constructor used to activate/export the object on a specified port. An "activatable" remote object must have a constructor that takes two arguments:

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.

Parameters:
id - activation identifier for the object
port - the port number on which the object is exported
Throws: RemoteException
if exporting the object to the RMI runtime fails

Methods

 o getID
protected ActivationID getID()
Returns the object's activation identifier. The method is protected so that only subclasses can obtain an object's identifier.

Returns:
the object's activation identifier
 o register
public static RemoteStub register(ActivationDesc desc) throws UnknownGroupException, ActivationException, RemoteException
Register an object descriptor for an activatable remote object so that is can be activated on demand.

Parameters:
desc - the object's descriptor
Returns:
the stub for the activatable remote object
Throws: UnknownGroupException
if group id in desc is not registered with the activation system
Throws: ActivationException
if activation system is not running
Throws: RemoteException
if remote call fails
 o inactive
public static void inactive(ActivationID id) throws UnknownObjectException, ActivationException, RemoteException
Informs the system that the object with the corresponding activation id is currently inactive. If the object is currently active, the object is forcibly "unexported" from the RMI runtime 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. After this call completes, subsequent activate request to the activator will cause the object to reactivate.

Parameters:
id - the object's activation identifier
Throws: UnknownObjectException
if object is not known (it may already be inactive)
Throws: ActivationException
if group is not active
Throws: RemoteException
if call informing monitor fails
 o unregister
public static void unregister(ActivationID id) throws UnknownObjectException, ActivationException, RemoteException
Revokes previous registration for the activation descriptor associated with id. An object can no longer be activated via that id.

Parameters:
id - the object's activation identifier
Throws: UnknownObjectException
if object (id) is unknown
Throws: ActivationException
if activation system is not running
Throws: RemoteException
if remote call to activation system fails
 o exportObject
public static ActivationID exportObject(Remote obj,
                                        CodeSource source,
                                        MarshalledObject data,
                                        int port) throws UnknownGroupException, ActivationException, RemoteException
This exportObject method may be invoked explicitly by an "activatable" object, that does not extend the Activatable class, in order to both a) register the object's activation descriptor, constructed from the supplied source, and data, with the activation system (so the object can be activated), and b) export the remote object, obj, 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 extends Activatable, since the first constructor calls this method.

Parameters:
obj - the object being exported
source - the object's code source
data - the object's bootstrapping data
port - the port on which the object is exported (an anonymous port is used if port=0)
Throws: UnknownGroupException
if attempt to export object in the wrong group
Throws: ActivationException
if activation group is not active
Throws: RemoteException
if object registration or export fails
 o exportObject
public static RemoteStub exportObject(Remote obj,
                                      ActivationID id,
                                      int port) throws RemoteException
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, if port is zero.

During activation, this exportObject method should be invoked explicitly by an "activatable" object, that does not extend the Activatable class. There is no need for objects that do extend the Activatable 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).

Parameters:
obj - the remote object implementation
id - the object's activation identifier
port - the port on which the object is exported (an anonymous port is used if port=0)
Returns:
the stub for the activatable remote object
Throws: RemoteException
if object export fails
 o exportObject
protected static RemoteStub exportObject(Remote obj,
                                         String refType,
                                         Class[] params,
                                         Object[] args) throws RemoteException

All Packages  Class Hierarchy  This Package  Previous  Next  Index  

Submit a bug or feature