java.rmi.server
Class SecureUnicastRemoteObject

java.lang.Object
  |
  +--java.rmi.server.SecureUnicastRemoteObject

public final class SecureUnicastRemoteObject
extends java.lang.Object

Exports a secure, non-replicated, remote object which has references that are valid only while the server process is alive.

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.

Since:
1.4

Method Summary
static java.rmi.Remote exportObject(java.rmi.Remote obj, SecureExportDesc desc)
          Exports a secure remote object, using the specified export descriptor, and returns a stub for the object.
static boolean unexportObject(java.rmi.Remote obj, boolean force)
          Unexports a secure remote object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

exportObject

public static java.rmi.Remote exportObject(java.rmi.Remote obj,
                                           SecureExportDesc desc)
                                    throws java.rmi.server.ExportException
Exports a secure remote object, using the specified export descriptor, and returns a stub for the object. The stub is only usable by clients for the duration of this virtual machine, or until the object is unexported.

Unlike UnicastRemoteObject, there is no automatic replacement of the stub for the implementation object during marshalling; either the stub must be passed explicitly, or the implementation class must be serializable and have a writeReplace method that returns the stub.

Parameters:
obj - the secure remote object
desc - the export descriptor
Returns:
a stub for the object
Throws:
java.rmi.server.ExportException - if a communication-related exception occurs, or the specified descriptor has method-specific constraints for a method that is neither a method from a remote interface nor the RemoteSecurity.getServerSubject method
java.lang.SecurityException - if the client endpoint produced by any server endpoint in the export descriptor is not an instance of a trusted class
NullPointerException - if any parameter is null

unexportObject

public static boolean unexportObject(java.rmi.Remote obj,
                                     boolean force)
                              throws java.rmi.NoSuchObjectException
Unexports a secure remote object. If the 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.
Parameters:
obj - the secure remote object
force - if true, forcibly unexport the object
Returns:
true if the object is unexported; false otherwise
Throws:
java.rmi.NoSuchObjectException - if the remote object is not currently exported


Copyright © 2000 Sun Microsystems, Inc. All rights reserved