RMIJRMPServerImplpublic class RMIJRMPServerImpl extends RMIServerImpl An {@link RMIServer} object that is exported through JRMP and that
creates client connections as RMI objects exported through JRMP.
User code does not usually reference this class directly. |
Fields Summary |
---|
private final int | port | private final RMIClientSocketFactory | csf | private final RMIServerSocketFactory | ssf | private final Map | env |
Constructors Summary |
---|
public RMIJRMPServerImpl(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf, Map env)Creates a new {@link RMIServer} object that will be exported
on the given port using the given socket factories.
super(env);
if (port < 0)
throw new IllegalArgumentException("Negative port: " + port);
this.port = port;
this.csf = csf;
this.ssf = ssf;
this.env = (env == null) ? Collections.EMPTY_MAP : env;
|
Methods Summary |
---|
protected void | closeClient(javax.management.remote.rmi.RMIConnection client)
unexport(client, true);
| protected void | closeServer()Called by {@link #close()} to close the connector server by
unexporting this object. After returning from this method, the
connector server must not accept any new connections.
unexport(this, true);
| protected void | export()
export(this);
| private void | export(java.rmi.Remote obj)
RMIExporter exporter =
(RMIExporter) env.get(RMIExporter.EXPORTER_ATTRIBUTE);
if (exporter == null)
UnicastRemoteObject.exportObject(obj, port, csf, ssf);
else
exporter.exportObject(obj, port, csf, ssf);
| protected java.lang.String | getProtocol()
return "rmi";
| protected javax.management.remote.rmi.RMIConnection | makeClient(java.lang.String connectionId, javax.security.auth.Subject subject)Creates a new client connection as an RMI object exported
through JRMP. The port and socket factories for the new
{@link RMIConnection} object are the ones supplied
to the RMIJRMPServerImpl constructor.
if (connectionId == null)
throw new NullPointerException("Null connectionId");
RMIConnection client =
new RMIConnectionImpl(this, connectionId, getDefaultClassLoader(),
subject, env);
export(client);
return client;
| public java.rmi.Remote | toStub()Returns a serializable stub for this {@link RMIServer} object.
return RemoteObject.toStub(this);
| private void | unexport(java.rmi.Remote obj, boolean force)
RMIExporter exporter =
(RMIExporter) env.get(RMIExporter.EXPORTER_ATTRIBUTE);
if (exporter == null)
UnicastRemoteObject.unexportObject(obj, force);
else
exporter.unexportObject(obj, force);
|
|