|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.activation.Activatable
public abstract class Activatable
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
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 |
---|
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,
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. |
Method Summary | |
---|---|
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) |
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 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 failed
RemoteException
- 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 factory
ActivationException
- if the activation failed
RemoteException
- 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 incoming calls.
anId
- the activation idport
- the port, on which the activatable will be listening
RemoteException
- 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 incoming calls.
anId
- the activation idport
- the port, on which the activatable will be listeningcsf
- the client socket factoryssf
- the server socket factory
RemoteException
- if the remote call failedMethod Detail |
---|
protected ActivationID getID()
public static Remote register(ActivationDesc desc) throws UnknownGroupException, ActivationException, RemoteException
desc
- the object description.
UnknownGroupException
- if the object group identifier is unknown
ActivationException
- if the activation system is not running
RemoteException
- if the remote call failspublic static boolean inactive(ActivationID id) throws UnknownObjectException, ActivationException, RemoteException
id
- the id of the object being inactivated
UnknownObjectException
- if the object is unknown.
ActivationException
- if the object group is not active
RemoteException
- if the remote call failspublic static void unregister(ActivationID id) throws UnknownObjectException, ActivationException, RemoteException
id
- the object id
UnknownObjectException
- if the id is unknown
ActivationException
- if the activation system is not running
RemoteException
- 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 available
ActivationException
- if the activation group is not active
RemoteException
- 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 factory
ActivationException
- if the activation group is not active
RemoteException
- 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 port
RemoteException
- 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 factory
RemoteException
- 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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |