java.rmi.activation
public abstract class Activatable extends RemoteServer
ActivationID
and the second the
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.ref
Modifier | Constructor and Description |
---|---|
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,
RMIClientSocketFactory csf,
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(String codebase,
MarshalledObject<?> data,
boolean restart,
int port)
This constructor is used to register export the object on the given port.
|
protected |
Activatable(String codebase,
MarshalledObject<?> data,
boolean restart,
int port,
RMIClientSocketFactory csf,
RMIServerSocketFactory ssf)
This constructor is used to register export the object on the given port,
additionally specifying the socket factories.
|
Modifier and Type | Method and Description |
---|---|
static Remote |
exportObject(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 Remote |
exportObject(Remote obj,
ActivationID id,
int port,
RMIClientSocketFactory csf,
RMIServerSocketFactory ssf)
During activation, this exportObject method should be invoked explicitly by
the activatable object, that does is not derived from the Activatable
class.
|
static ActivationID |
exportObject(Remote obj,
String location,
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(Remote obj,
String location,
MarshalledObject data,
boolean restart,
int port,
RMIClientSocketFactory csf,
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 Remote |
register(ActivationDesc desc)
This method registers an activatable object.
|
static boolean |
unexportObject(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)
|
getClientHost, getLog, setLog
protected Activatable(String codebase, MarshalledObject<?> data, boolean restart, int port) throws ActivationException, RemoteException
codebase
- the object code base urldata
- the data, needed to activate the object.restart
- specifies reactivation mode after crash. If true, the object
is activated when activator is restarted or the activation group
is restarted. If false, the object is only activated on demand.
This flag does has no effect during the normal operation (the
object is normally activated on demand).port
- the port, on which the object will become available. The value
0 means anonymous port.ActivationException
- if the activation failedRemoteException
- if the remote call failed.protected Activatable(String codebase, MarshalledObject<?> data, boolean restart, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws ActivationException, RemoteException
codebase
- the object code base urldata
- the data, needed to activate the object.restart
- specifies reactivation mode after crash. If true, the object
is activated when activator is restarted or the activation group
is restarted. If false, the object is only activated on demand.
This flag does has no effect during the normal operation (the
object is normally activated on demand).port
- the port, on which the object will become available. The value
0 means anonymous port.csf
- the client socket factoryssf
- the server socket factoryActivationException
- if the activation failedRemoteException
- if the remote call failed.protected Activatable(ActivationID anId, int port) throws RemoteException
ActivationID
,
MarshalledObject
). As a side effect, the object is exported and is
available to accept incomming calls.anId
- the activation idport
- the port, on which the activatable will be listeningRemoteException
- if the activation failed.protected Activatable(ActivationID anId, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException
ActivationID
,
MarshalledObject
). As a side effect, the object is exported and is
available to accept incomming calls.anId
- the activation idport
- the port, on which the activatable will be listeningcsf
- the client socket factoryssf
- the server socket factoryRemoteException
- if the remote call failedprotected ActivationID getID()
public static Remote register(ActivationDesc desc) throws UnknownGroupException, ActivationException, RemoteException
desc
- the object description.UnknownGroupException
- if the object group identifier is unknownActivationException
- if the activation system is not runningRemoteException
- if the remote call failspublic static boolean inactive(ActivationID id) throws UnknownObjectException, ActivationException, RemoteException
id
- the id of the object being inactivatedUnknownObjectException
- if the object is unknown.ActivationException
- if the object group is not activeRemoteException
- if the remote call failspublic static void unregister(ActivationID id) throws UnknownObjectException, ActivationException, RemoteException
id
- the object idUnknownObjectException
- if the id is unknownActivationException
- if the activation system is not runningRemoteException
- if the remote call fails.public static ActivationID exportObject(Remote obj, String location, MarshalledObject<?> data, boolean restart, int port) throws ActivationException, RemoteException
Activatable(String, MarshalledObject, boolean, int)
.obj
- the object, that is exported, becoming available at the given
port.location
- the object code location (codebase).data
- the data, needed to activate the objectrestart
- the restart modeport
- the port, where the object will be availableActivationException
- if the activation group is not activeRemoteException
- if the registration or export failspublic static ActivationID exportObject(Remote obj, String location, MarshalledObject data, boolean restart, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws ActivationException, RemoteException
Activatable(String, MarshalledObject, boolean, int, RMIClientSocketFactory, RMIServerSocketFactory)
obj
- the object, that is exported, becoming available at the given
port.location
- the object code location (codebase).data
- the data, needed to activate the objectrestart
- the restart modeport
- the port, where the object will be availablecsf
- the client socket factoryssf
- the server socket factoryActivationException
- if the activation group is not activeRemoteException
- if the registration or export failspublic static Remote exportObject(Remote obj, ActivationID id, int port) throws RemoteException
Activatable(ActivationID, int)
obj
- the objectid
- the known activation idport
- the object portRemoteException
- if the object export failspublic static Remote exportObject(Remote obj, ActivationID id, int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException
Activatable(ActivationID, int)
obj
- the objectid
- the known activation idport
- the object portcsf
- the client socket factoryssf
- the server socket factoryRemoteException
- if the object export failspublic static boolean unexportObject(Remote obj, boolean force) throws NoSuchObjectException
obj
- the object to unexportforce
- if true, cancel all pending or running calls to that object
(if false, the object with such calls is not unexported and false
is returned by this method).NoSuchObjectException
- if such object is not known