/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* <p>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.</p>
*
* @see RMIServerImpl
*
* @since 1.5
*/
/**
* <p>Creates a new {@link RMIServer} object that will be exported
* on the given port using the given socket factories.</p>
*
* @param port the port on which this object and the {@link
* RMIConnectionImpl} objects it creates will be exported. Can be
* zero, to indicate any available port.
*
* @param csf the client socket factory for the created RMI
* objects. Can be null.
*
* @param ssf the server socket factory for the created RMI
* objects. Can be null.
*
* @param env the environment map. Can be null.
*
* @exception IOException if the {@link RMIServer} object
* cannot be created.
*
* @exception IllegalArgumentException if <code>port</code> is
* negative.
*/
throws IOException {
super(env);
if (port < 0)
}
export(this);
}
final RMIExporter exporter =
" cannot be used to specify an exporter!");
}
if (daemon) {
} else {
}
} else {
}
}
throws NoSuchObjectException {
else
}
return "rmi";
}
/**
* <p>Returns a serializable stub for this {@link RMIServer} object.</p>
*
* @return a serializable stub.
*
* @exception IOException if the stub cannot be obtained - e.g the
* RMIJRMPServerImpl has not been exported yet.
*/
return RemoteObject.toStub(this);
}
/**
* <p>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 <code>RMIJRMPServerImpl</code> constructor.</p>
*
* @param connectionId the ID of the new connection. Every
* connection opened by this connector server will have a
* different id. The behavior is unspecified if this parameter is
* null.
*
* @param subject the authenticated subject. Can be null.
*
* @return the newly-created <code>RMIConnection</code>.
*
* @exception IOException if the new {@link RMIConnection}
* object cannot be created or exported.
*/
throws IOException {
if (connectionId == null)
throw new NullPointerException("Null connectionId");
return client;
}
}
/**
* <p>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.</p>
*
* @exception IOException if the attempt to close the connector
* server failed.
*/
unexport(this, true);
}
private final int port;
}