站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档

Java Remote Method Invocation: 5 - Server Interfaces - JDK 5 Documentation v1.2.2, Java 2 SDK 英文文档

CONTENTS | PREV | NEXT Java Remote Method Invocation


5.2 The RemoteServer Class

The java.rmi.server.RemoteServer class is the common superclass to the server implementation classes java.rmi.server.UnicastRemoteObject and java.rmi.activation.Activatable.

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 exception ServerNotActiveException is thrown if no remote method is active in 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.