Contents | Package | Class | Tree | Deprecated | Index | Help | Java 1.2 Beta 3 | ||
PREV | NEXT | SHOW LISTS | HIDE LISTS |
java.lang.Object | +----java.rmi.server.RemoteObject | +----java.rmi.server.RemoteServer | +----java.rmi.activation.Activatable
Activatable
class provides support for remote
objects that require persistent access over time and that
can be activated by the system.
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Constructor Summary | |
Activatable(CodeSource source,
MarshalledObject data,
int port)
|
|
Activatable(CodeSource source,
MarshalledObject data,
boolean restart,
int port)
|
|
Activatable(ActivationID id,
int port)
|
Method Summary | |
static ActivationID | exportObject(Remote obj,
CodeSource source,
MarshalledObject data,
int port)
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).
|
static ActivationID | exportObject(Remote obj,
CodeSource source,
MarshalledObject data,
boolean restart,
int port)
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).
|
static Remote | exportObject(Remote obj,
ActivationID id,
int port)
|
ActivationID | getID()
|
static boolean | inactive(ActivationID id)
id is currently inactive.
|
static Remote | register(ActivationDesc desc)
|
static void | unregister(ActivationID id)
id .
|
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog, unexportObject |
Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected Activatable(CodeSource source, MarshalledObject data, int port) throws ActivationException, RemoteException
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. Note that objects created via this constructor will be activated on demand, not restarted when the activation daemon starts. If an activatable objects requires restart when the activation daemon rmid starts, use the second Activatable constructor form.
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)
protected Activatable(CodeSource source, MarshalledObject data, boolean restart, int port) throws ActivationException, RemoteException
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)
restart
- if true, the object is restarted when the activator
is restarted; if false, the object is activated on demand.
protected Activatable(ActivationID id, int port) throws RemoteException
ActivationID
), and
MarshalledObject
).
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.
id
- activation identifier for the object
port
- the port number on which the object is exported
Method Detail |
protected ActivationID getID()
public static Remote register(ActivationDesc desc) throws UnknownGroupException, ActivationException, RemoteException
desc
- the object's descriptor
desc
is not registered with the activation systempublic static boolean inactive(ActivationID id) throws UnknownObjectException, ActivationException, RemoteException
id
is currently inactive. If the object is currently
active, the object is "unexported" from the RMI runtime (only if
there are no pending or in-progress calls)
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. If this call
completes successfully, a subsequent activate request to the activator
will cause the object to reactivate. The operation may still
succeed if the object is considered active but has already
unexported itself.
id
- the object's activation identifier
public static void unregister(ActivationID id) throws UnknownObjectException, ActivationException, RemoteException
id
. An object can no longer be
activated via that id
.
id
- the object's activation identifier
id
) is unknownpublic static ActivationID exportObject(Remote obj, CodeSource source, MarshalledObject data, int port) throws ActivationException, RemoteException
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.
Note that objects exported via this method will be activated
on demand, not restarted when the activation daemon starts. If
an activatable objects requires restart when the activation daemon
rmid starts, use the second exportObject
method (the
one that takes the parameter restart
).
This method does not need to be called if obj
extends Activatable
, since the first constructor
calls this method.
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)
public static ActivationID exportObject(Remote obj, CodeSource source, MarshalledObject data, boolean restart, int port) throws ActivationException, RemoteException
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.
obj
- the object being exported
source
- the object's code source
data
- the object's bootstrapping data
restart
- if true, the object is restarted when the activator
is restarted; if false, the object is activated on demand.
port
- the port on which the object is exported (an anonymous
port is used if port=0)
public static Remote exportObject(Remote obj, ActivationID id, int port) throws RemoteException
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).
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)
Contents | Package | Class | Tree | Deprecated | Index | Help | Java 1.2 Beta 3 | ||
PREV | NEXT | SHOW LISTS | HIDE LISTS |