is new.
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.activation.Activatable
public abstract class Activatable
The Activatable class provides support for remote objects that require persistent access over time and that can be activated by the system.
For the constructors and static exportObject methods, the stub for a remote object being exported is obtained as described in UnicastRemoteObject .
An attempt to serialize explicitly an instance of this class will fail.
| Field Summary |
|---|
| Fields inherited from class java.rmi.server. RemoteObject |
|---|
| ref |
| Constructor Summary | |
|---|---|
| protected |
Activatable
(
ActivationID
id, int port) Constructor used to activate/export the object on a specified port. |
| protected |
Activatable
(
ActivationID
id, int port,
RMIClientSocketFactory
csf,
RMIServerSocketFactory
ssf) Constructor used to activate/export the object on a specified port. |
| protected |
Activatable
(
String
location,
MarshalledObject
Constructs an activatable remote object by registering an activation descriptor (with the specified location, data,
restart mode) for this object, and exporting
with the
port.
|
| protected |
Activatable
(
String
location,
MarshalledObject
<?> data,
Constructs an activatable remote object by registering an activation descriptor (with the specified location, data,
restart mode) for this object, and exporting
with the
port, and specified client and server socket factories.
|
| Method Summary | |
|---|---|
| static Remote |
exportObject
(
Remote
obj,
ActivationID
id, int port) Export the activatable remote object to the RMI runtime to make the object available to receive incoming calls. |
| static Remote |
exportObject
(
Remote
obj,
ActivationID
id, int port,
RMIClientSocketFactory
csf,
RMIServerSocketFactory
ssf) Export the activatable remote object to the RMI runtime to make the object available to receive incoming calls. |
static
ActivationID
|
exportObject
(
Remote
obj,
String
location,
MarshalledObject
Registers an activation descriptor (with the specified location, data, and restart mode) for the specified object, and exports that object with the specified port.
|
|
|
static
ActivationID
|
exportObject
(
Remote
obj,
String
location,
MarshalledObject
<?> data, boolean restart, int port,
RMIClientSocketFactory
csf,
RMIServerSocketFactory
Registers an activation descriptor (with the specified location, data, and restart mode) for the specified object, and exports that object with the specified port, and the specified client and server socket factories.
|
|
|
| protected ActivationID |
getID
() Returns the object's activation identifier. |
| static boolean |
inactive
(
ActivationID
id) Informs the system that the object with the corresponding activation id is currently inactive. |
| static Remote |
register
(
ActivationDesc
desc) Register an object descriptor for an activatable remote object so that is can be activated on demand. |
| static boolean |
unexportObject
(
Remote
obj, boolean force) Remove the remote object, obj, from the RMI runtime. |
| static void |
unregister
(
ActivationID
id) Revokes previous registration for the activation descriptor associated with 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 |
| Constructor Detail |
|---|
protected Activatable(String location,
MarshalledObject
<?> data,

data,
boolean restart,
int port)
throws ActivationException,
RemoteException
Constructs an activatable remote object by registering an activation descriptor (with the specified location, data, and restart mode) for this object, and exporting the object with the specified port.
Note: Using the Activatable constructors that both register and export an activatable remote object is strongly discouraged because the actions of registering and exporting the remote object are
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
not
initial
guaranteed to be atomic. Instead, an application should register an activation descriptor and export a remote object separately, so that exceptions can be handled properly.
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.
This method invokes the exportObject method with this object, and the specified location, data, restart mode, and port. Subsequent calls to
getID()
will return the activation identifier returned from the call to exportObject.
protected Activatable(String location,
MarshalledObject
<?> data,

data,
boolean restart,
int port,
RMIClientSocketFactory csf,
RMIServerSocketFactory ssf)
throws ActivationException,
RemoteException
Constructs an activatable remote object by registering an activation descriptor (with the specified location, data, and restart mode) for this object, and exporting the object with the specified port, and specified client and server socket factories.
Note: Using the Activatable constructors that both register and export an activatable remote object is strongly discouraged because the actions of registering and exporting the remote object are
A concrete subclass of this class must call this constructor to register and export the object during
not
initial
guaranteed to be atomic. Instead, an application should register an activation descriptor and export a remote object separately, so that exceptions can be handled properly.
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.
This method invokes the exportObject method with this object, and the specified location, data, restart mode, port, and client and server socket factories. Subsequent calls to
getID()
will return the activation identifier returned from the call to exportObject.
protected Activatable(ActivationID id,
int port)
throws RemoteException
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.
protected Activatable(ActivationID id,
int port,
RMIClientSocketFactory csf,
RMIServerSocketFactory ssf)
throws RemoteException
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.
| Method Detail |
|---|
protected ActivationID getID()
public static Remote register(ActivationDesc desc)
throws UnknownGroupException,
ActivationException,
RemoteException
public static boolean inactive(ActivationID id)
throws UnknownObjectException,
ActivationException,
RemoteException
public static void unregister(ActivationID id)
throws UnknownObjectException,
ActivationException,
RemoteException
public static ActivationIDexportObject(Remote obj,
String location,
MarshalledObject
<?> data,

data,
boolean restart,
int port)
throws ActivationException,
RemoteException
Registers an activation descriptor (with the specified location, data, and restart mode) for the specified object, and exports that object with the specified port.
Note: Using this method (as well as the Activatable constructors that both register and export an activatable remote object) is strongly discouraged because the actions of registering and exporting the remote object are
not
guaranteed to be atomic. Instead, an application should register an activation descriptor and export a remote object separately, so that exceptions can be handled properly.
This method does not need to be called if obj extends Activatable, since the first constructor calls this method.
This method invokes the exportObject method with the specified object, location, data, restart mode, and port, and null for both client and server socket factories, and then returns the resulting activation identifier.
public static ActivationIDexportObject(Remote obj,
String location,
MarshalledObject
<?> data,

data,
boolean restart,
int port,
RMIClientSocketFactory csf,
RMIServerSocketFactory ssf)
throws ActivationException,
RemoteException
Registers an activation descriptor (with the specified location, data, and restart mode) for the specified object, and exports that object with the specified port, and the specified client and server socket factories.
Note: Using this method (as well as the Activatable constructors that both register and export an activatable remote object) is strongly discouraged because the actions of registering and exporting the remote object are
not
guaranteed to be atomic. Instead, an application should register an activation descriptor and export a remote object separately, so that exceptions can be handled properly.
This method does not need to be called if obj extends Activatable, since the first constructor calls this method.
This method first registers an activation descriptor for the specified object as follows. It obtains the activation system by invoking the method
ActivationGroup.getSystem
. This method then obtains an
ActivationID
for the object by invoking the activation system's
registerObject
method with an
ActivationDesc
constructed with the specified object's class name, and the specified location, data, and restart mode. If an exception occurs obtaining the activation system or registering the activation descriptor, that exception is thrown to the caller.
Next, this method exports the object by invoking the
exportObject
method with the specified remote object, the activation identifier obtained from registration, the specified port, and the specified client and server socket factories. If an exception occurs exporting the object, this method attempts to unregister the activation identifier (obtained from registration) by invoking the activation system's
unregisterObject
method with the activation identifier. If an exception occurs unregistering the identifier, that exception is ignored, and the original exception that occurred exporting the object is thrown to the caller.
Finally, this method invokes the
activeObject
method on the activation group in this VM with the activation identifier and the specified remote object, and returns the activation identifier to the caller.
descriptor
public static Remote exportObject(Remote obj,
ActivationID id,
int port)
throws RemoteException
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 because
directly; this method is called by
the
object is exported during construction.
second constructor above (which a subclass should invoke from its special activation constructor).
public static Remote exportObject(Remote obj,
ActivationID id,
int port,
RMIClientSocketFactory csf,
RMIServerSocketFactory ssf)
throws RemoteException
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 because
directly; this method is called by
the
object is exported during construction.
second constructor above (which a subclass should invoke from its special activation constructor).
public static boolean unexportObject(Remote obj,
boolean force)
throws NoSuchObjectException