Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

java.rmi.activation
Class Activatable  view Activatable download Activatable.java

java.lang.Object
  extended byjava.rmi.server.RemoteObject
      extended byjava.rmi.server.RemoteServer
          extended byjava.rmi.activation.Activatable
All Implemented Interfaces:
java.rmi.Remote, java.io.Serializable

public abstract class Activatable
extends java.rmi.server.RemoteServer

A common ancestor for the implementations of the activatable objects. Such objects require persistent access over time and can be activated by the system. The derived classes also implements the needed interface of some remote object and usually have the two parameter constructor, the first parameter being the ActivationID and the second the java.rmi.MarshalledObject. Activatable is the main class that developers need to use to implement and manage activatable objects. It also contains methods for making activatable remote objects that are not derived from the Activatable class.


Field Summary
(package private)  ActivationID id
          The object activation id.
(package private) static long serialVersionUID
          Use SVUID for interoperability.
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
protected Activatable(ActivationID anId, int port)
          Creates the new instance of activatable with the given activation id and is listening at the given port.
protected Activatable(ActivationID anId, int port, java.rmi.server.RMIClientSocketFactory csf, java.rmi.server.RMIServerSocketFactory ssf)
          Creates the new instance of activatable with the given activation id and is listening at the given port, using the specified client and server sockets factories.
protected Activatable(java.lang.String codebase, java.rmi.MarshalledObject data, boolean restart, int port)
          This constructor is used to register export the object on the given port.
protected Activatable(java.lang.String codebase, java.rmi.MarshalledObject data, boolean restart, int port, java.rmi.server.RMIClientSocketFactory csf, java.rmi.server.RMIServerSocketFactory ssf)
          This constructor is used to register export the object on the given port, additionally specifying the socket factories.
 
Method Summary
static java.rmi.Remote export(ActivationID id, java.rmi.Remote obj, int port, java.rmi.server.RMIServerSocketFactory serverSocketFactory)
          Create and export the new remote object, making it available at the given port, using sockets, produced by the specified factories.
static java.rmi.Remote exportObject(java.rmi.Remote obj, ActivationID id, int port)
          During activation, this exportObject method should be invoked explicitly by the activatable object, that does is not derived from the Activatable class.
static java.rmi.Remote exportObject(java.rmi.Remote obj, ActivationID id, int port, java.rmi.server.RMIClientSocketFactory csf, java.rmi.server.RMIServerSocketFactory ssf)
          During activation, this exportObject method should be invoked explicitly by the activatable object, that does is not derived from the Activatable class.
(package private) static java.rmi.Remote exportObject(java.rmi.Remote obj, int port, java.rmi.server.RMIServerSocketFactory serverSocketFactory)
           
static ActivationID exportObject(java.rmi.Remote obj, java.lang.String location, java.rmi.MarshalledObject data, boolean restart, int port)
          Register and export the object that activatable object that is not derived from the Activatable super class.
static ActivationID exportObject(java.rmi.Remote obj, java.lang.String location, java.rmi.MarshalledObject data, boolean restart, int port, java.rmi.server.RMIClientSocketFactory csf, java.rmi.server.RMIServerSocketFactory ssf)
          Register and export the object that activatable object that is not derived from the Activatable super class.
protected  ActivationID getID()
          Get the objects activation identifier.
static boolean inactive(ActivationID id)
          Inactivates and unexports the object.
static java.rmi.server.ObjID makeId(ActivationID aid)
          Make the object ID from the activation ID.
(package private) static ActivationID obtainId(ActivationDesc descriptor)
          Obtain the activation Id from the activation descriptor by registering within the current group.
static java.rmi.Remote register(ActivationDesc desc)
          This method registers an activatable object.
(package private) static java.rmi.Remote toStub(ActivationID anId, java.lang.Class stubFor)
          Connect the object to the UnicastServer (export), but not activate it.
static boolean unexportObject(java.rmi.Remote obj, boolean force)
          Make the remote object unavailable for incoming calls.
static void unregister(ActivationID id)
          Unregister the object (the object will no longer be activable with that id)
 
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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
Use SVUID for interoperability.

See Also:
Constant Field Values

id

final ActivationID id
The object activation id.

Constructor Detail

Activatable

protected Activatable(java.lang.String codebase,
                      java.rmi.MarshalledObject data,
                      boolean restart,
                      int port)
               throws ActivationException,
                      java.rmi.RemoteException
This constructor is used to register export the object on the given port. A subclass of the Activatable class calls 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 is zero) to the RMI runtime so that it is available to accept incoming calls from clients.


Activatable

protected Activatable(java.lang.String codebase,
                      java.rmi.MarshalledObject data,
                      boolean restart,
                      int port,
                      java.rmi.server.RMIClientSocketFactory csf,
                      java.rmi.server.RMIServerSocketFactory ssf)
               throws ActivationException,
                      java.rmi.RemoteException
This constructor is used to register export the object on the given port, additionally specifying the socket factories. A subclass of the Activatable class calls this constructor to register and export the object during initial construction.


Activatable

protected Activatable(ActivationID anId,
                      int port)
               throws java.rmi.RemoteException
Creates the new instance of activatable with the given activation id and is listening at the given port. A subclass of the Activatable class calls this constructor when the object itself is activated via its special "activation" constructor with the two parameters (ActivationID, java.rmi.MarshalledObject). As a side effect, the object is exported and is available to accept incomming calls.


Activatable

protected Activatable(ActivationID anId,
                      int port,
                      java.rmi.server.RMIClientSocketFactory csf,
                      java.rmi.server.RMIServerSocketFactory ssf)
               throws java.rmi.RemoteException
Creates the new instance of activatable with the given activation id and is listening at the given port, using the specified client and server sockets factories. A subclass of the Activatable class calls this constructor when the object itself is activated via its special "activation" constructor with the two parameters (ActivationID, java.rmi.MarshalledObject). As a side effect, the object is exported and is available to accept incomming calls.

Method Detail

getID

protected ActivationID getID()
Get the objects activation identifier.


obtainId

static ActivationID obtainId(ActivationDesc descriptor)
                      throws java.rmi.RemoteException,
                             UnknownGroupException,
                             ActivationException
Obtain the activation Id from the activation descriptor by registering within the current group.


register

public static java.rmi.Remote register(ActivationDesc desc)
                                throws UnknownGroupException,
                                       ActivationException,
                                       java.rmi.RemoteException
This method registers an activatable object. The object is expected to be on the anonymous port (null client and server socket factories).


inactive

public static boolean inactive(ActivationID id)
                        throws UnknownObjectException,
                               ActivationException,
                               java.rmi.RemoteException
Inactivates and unexports the object. The subsequent calls will activate the object again. The object is not inactivated if it is currently executing calls.


unregister

public static void unregister(ActivationID id)
                       throws UnknownObjectException,
                              ActivationException,
                              java.rmi.RemoteException
Unregister the object (the object will no longer be activable with that id)


exportObject

public static ActivationID exportObject(java.rmi.Remote obj,
                                        java.lang.String location,
                                        java.rmi.MarshalledObject data,
                                        boolean restart,
                                        int port)
                                 throws ActivationException,
                                        java.rmi.RemoteException
Register and export the object that activatable object that is not derived from the Activatable super class. It creates and registers the object activation descriptor. There is no need to call this method if the object extends Activable, as its work is done in the constructor Activatable(String, MarshalledObject, boolean, int) 55 .


exportObject

public static ActivationID exportObject(java.rmi.Remote obj,
                                        java.lang.String location,
                                        java.rmi.MarshalledObject data,
                                        boolean restart,
                                        int port,
                                        java.rmi.server.RMIClientSocketFactory csf,
                                        java.rmi.server.RMIServerSocketFactory ssf)
                                 throws ActivationException,
                                        java.rmi.RemoteException
Register and export the object that activatable object that is not derived from the Activatable super class. It creates and registers the object activation descriptor. There is no need to call this method if the object extends Activable, as its work is done in the constructor Activatable(String, MarshalledObject, boolean, int, RMIClientSocketFactory, RMIServerSocketFactory) 55


exportObject

public static java.rmi.Remote exportObject(java.rmi.Remote obj,
                                           ActivationID id,
                                           int port)
                                    throws java.rmi.RemoteException
During activation, this exportObject method should be invoked explicitly by the activatable object, that does is not derived from the Activatable class. There is no need to call this method if the object extends Activable, as its work is done in the constructor Activatable(ActivationID, int) 55


exportObject

public static java.rmi.Remote exportObject(java.rmi.Remote obj,
                                           ActivationID id,
                                           int port,
                                           java.rmi.server.RMIClientSocketFactory csf,
                                           java.rmi.server.RMIServerSocketFactory ssf)
                                    throws java.rmi.RemoteException
During activation, this exportObject method should be invoked explicitly by the activatable object, that does is not derived from the Activatable class. There is no need to call this method if the object extends Activable, as its work is done in the constructor Activatable(ActivationID, int) 55


unexportObject

public static boolean unexportObject(java.rmi.Remote obj,
                                     boolean force)
                              throws java.rmi.NoSuchObjectException
Make the remote object unavailable for incoming calls. This method also unregisters the object, so it cannot be activated again by incomming call (unless registered).


exportObject

static java.rmi.Remote exportObject(java.rmi.Remote obj,
                                    int port,
                                    java.rmi.server.RMIServerSocketFactory serverSocketFactory)
                             throws java.rmi.RemoteException

export

public static java.rmi.Remote export(ActivationID id,
                                     java.rmi.Remote obj,
                                     int port,
                                     java.rmi.server.RMIServerSocketFactory serverSocketFactory)
                              throws java.rmi.RemoteException
Create and export the new remote object, making it available at the given port, using sockets, produced by the specified factories.


makeId

public static java.rmi.server.ObjID makeId(ActivationID aid)
Make the object ID from the activation ID. The same activation ID always produces the identical object id.


toStub

static java.rmi.Remote toStub(ActivationID anId,
                              java.lang.Class stubFor)
Connect the object to the UnicastServer (export), but not activate it. The object will be activated on the first call.