CONTENTS | PREV | NEXT | Java Remote Method Invocation |
RemoteServer
Class
Thejava.rmi.server.RemoteServer
class is the common superclass to the server implementation classesjava.rmi.server.UnicastRemoteObject
andjava.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 theRemoteServer
class is abstract, it cannot be instantiated. Therefore, one ofRemoteServer
's constructors must be called from a subclass implementation. The firstRemoteServer
constructor creates aRemoteServer
with anull
remote reference. The secondRemoteServer
constructor creates aRemoteServer
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 exceptionServerNotActiveException
is thrown if no remote method is active in the current thread. ThesetLog
method logs RMI calls to the specified output stream. If the output stream isnull
, 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.