CONTENTS | PREV | NEXT | Java Remote Method Invocation |
The java.rmi.server.RemoteServer class is the common superclass to all server implementations and provides the framework to support a wide range of remote reference semantics. At present the only subclass supported is UnicastRemoteObject.package java.rmi.server;
public abstract class RemoteServer extends RemoteObject {
protected RemoteServer();
protected RemoteServer(RemoteRef ref);
public static boolean unexportObject(java.rmi.Remote obj,
boolean force)
throws java.rmi.NoSuchObjectException;
public static String getClientHost()
throws ServerNotActiveException;
public static void setLog(java.io.OutputStream out);Since the RemoteServer class is abstract, it cannot be instantiated. Therefore, one of RemoteServer's constructors must be called from a subclass implementation. The first RemoteServer constructor creates a RemoteServer with a null remote reference. The second RemoteServer constructor creates a RemoteServer with the given remote reference, ref.
public static java.io.PrintStream getLog();
}The
unexportObject
method makes the remote object, obj, unavailable for incoming calls. The RMI runtime removes the object from its internal tables. Removing the object from RMI use in this forcible manner may leave clients holding stale remote references to the remote object. This method throws java.rmi.NoSuchObjectException if the object was not previously exported to the RMI runtime.The
getClientHost
method allows an active method to determine the host that initiated the remote method active in the current thread. The ServerNotActiveException is thrown if no remote method is active on the current thread. ThesetLog
method logs RMI calls to the specified output stream. If the output stream is null, call logging is turned off. ThegetLog
method returns the stream for the RMI call log, so that application-specific information can be written to the call log in a synchronized manner.