|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.activation.SecureActivatable
Registers and exports a secure remote object that permits persistent access over time and that can be activated on demand by the system.
This class cannot be subclassed or instantiated; the static methods should simply be used as necessary in implementation classes or in code that exports remote objects.
The exported object can perform preinvocation access control and exercise
control over parameter unmarshalling and result marshalling by implementing
RemoteCallControl
.
Threads executing incoming remote calls for secure remote objects can
use the context methods in the
SecureRemoteServer
class.
Method Summary | |
static java.rmi.Remote |
exportObject(java.rmi.Remote obj,
java.rmi.activation.ActivationID id,
SecureExportDesc desc)
Exports an object that has been activated, using the specified activation identifier and export descriptor, and returns a stub for the object. |
static boolean |
inactive(java.rmi.activation.ActivationID id)
Makes the object with the corresponding activation identifier inactive, if possible. |
static java.rmi.Remote |
register(java.rmi.activation.ActivationDesc desc,
SecurityConstraints activatorConstraints)
Registers a new secure activatable object with the default activation system for this VM (as returned by ActivationGroup.getSystem ) using the specified activation descriptor,
before the activatable object has ever been created, and returns a stub
for the object. |
static java.rmi.Remote |
register(java.rmi.activation.ActivationSystem sys,
java.rmi.activation.ActivationDesc desc,
SecurityConstraints activatorConstraints)
Registers a new secure activatable object with the specified activation system using the specified activation descriptor, before the activatable object has ever been created, and returns a stub for the object. |
static boolean |
unexportObject(java.rmi.Remote obj,
boolean force)
Unexports a remote object. |
static void |
unregister(java.rmi.activation.ActivationID id)
Unregisters the activation descriptor associated with the specified activation identifier. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.rmi.Remote register(java.rmi.activation.ActivationDesc desc, SecurityConstraints activatorConstraints) throws java.rmi.activation.ActivationException, java.rmi.RemoteException
ActivationGroup.getSystem
) using the specified activation descriptor,
before the activatable object has ever been created, and returns a stub
for the object. The object will subsequently be activated on demand.
The activatorConstraints
are set as client constraints on
the activation identifier contained in the returned stub.
The class specified in the activation descriptor must have a declared
constructor that takes two parameters: an ActivationID
and
a MarshalledObject
. This constructor is called by the
activation group whenever an object is activated. The class also must
be serializable, must not be abstract, and must have a
serialization-compatible writeReplace
method that returns
the stub.
desc
- the activation descriptoractivatorConstraints
- the client constraints for the
activation identifier contained in the returned stub, or
null
java.rmi.activation.ActivationException
- if the default activation system cannot be
obtained or does not implement RemoteSecurity
, or the class specified in the activation descriptor
cannot be loaded or does not have the required constructor or
writeReplace
method or is not serializable or is abstract,
or the remote call to the activation system throws
ActivationException
java.rmi.RemoteException
- if a communication-related exception occursNullPointerException
- if the activation descriptor is
null
public static java.rmi.Remote register(java.rmi.activation.ActivationSystem sys, java.rmi.activation.ActivationDesc desc, SecurityConstraints activatorConstraints) throws java.rmi.activation.ActivationException, java.rmi.RemoteException
activatorConstraints
are set as client constraints on the
activation identifier contained in the returned stub.
The class specified in the activation descriptor must have a declared
constructor that takes two arguments: an ActivationID
and
a MarshalledObject
. This constructor is called by the
activation group whenever an object is activated. The class also must
be serializable and must have a serialization-compatible
writeReplace
method that returns the stub.
sys
- the activation systemdesc
- the activation descriptoractivatorConstraints
- the client constraints for the
activation identifier contained in the returned stub, or
null
java.rmi.activation.ActivationException
- if the activation system does not implement
RemoteSecurity
, or the class specified
in the activation descriptor cannot be loaded or does not have the
required constructor or writeReplace
method or is not
serializable or is abstract, or the remote call to the activation
system throws ActivationException
java.rmi.RemoteException
- if a communication-related exception occursNullPointerException
- if the activation descriptor is
null
public static boolean inactive(java.rmi.activation.ActivationID id) throws java.rmi.activation.ActivationException, java.rmi.RemoteException
true
if the object has successfully been made
inactive, and false
if the object is currently exported
and has pending or in-progress calls. If this call completes
successfully, a subsequent activate request to the activator will
cause the object to reactivate.id
- the activation identifierjava.rmi.activation.UnknownObjectException
- if object is not known (it may already
be inactive)java.rmi.activation.ActivationException
- if the group is not activejava.rmi.RemoteException
- if the activation monitor remote call failsunexportObject(java.rmi.Remote, boolean)
public static void unregister(java.rmi.activation.ActivationID id) throws java.rmi.activation.ActivationException, java.rmi.RemoteException
id
- the activation identifierjava.rmi.activation.UnknownObjectException
- if the object is unknownjava.rmi.activation.ActivationException
- if activation system is not runningjava.rmi.RemoteException
- if the activation system remote call failspublic static java.rmi.Remote exportObject(java.rmi.Remote obj, java.rmi.activation.ActivationID id, SecureExportDesc desc) throws java.rmi.server.ExportException
There is no automatic replacement of the stub for the implementation
object during marshalling; the implementation class of the object must
be serializable and must have a serialization-compatible
writeReplace
method that returns the stub.
obj
- the secure activatable objectid
- the activation iddesc
- the export descriptorjava.rmi.server.ExportException
- if the implementation class of the specified
object is not serializable or does not have the required
writeReplace
method, or a communication-related exception
occursjava.lang.SecurityException
- if the client endpoint produced by any server
endpoint in the export descriptor is not an instance of a trusted classNullPointerException
- if any parameter is null
public static boolean unexportObject(java.rmi.Remote obj, boolean force) throws java.rmi.NoSuchObjectException
force
parameter is
true
, the object is forcibly unexported even if there are
pending calls to the remote object or the remote object still has calls
in progress. If the force
parameter is
false
, the object is only unexported if there are no
pending or in progress calls to the object. The return value is
true
if the object is unexported, and false
otherwise.obj
- the secure remote objectforce
- if true
, forcibly unexport the objecttrue
if the object is unexported;
false
otherwisejava.rmi.NoSuchObjectException
- if the remote object is not
currently exported
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |