CONTENTS | PREV | NEXT Java Remote Method Invocation


5.2 The RemoteServer Class

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 String getClientHost()
		throws ServerNotActiveException;

	public static void setLog(java.io.OutputStream out);



	public static java.io.PrintStream getLog();
}


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.

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. The setLog method logs RMI calls to the specified output stream. If the output stream is null, call logging is turned off. The getLog 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.



CONTENTS | PREV | NEXT
Copyright © 1997-1998 Sun Microsystems, Inc. All Rights Reserved.