APIdia Launch Partner
Top Description Fields Constructors Methods
javax.management.remote.rmi

public Class RMIJRMPServerImpl

extends RMIServerImpl
Class Inheritance
Imports
java.io.IOException, .ObjectInputFilter, java.rmi.NoSuchObjectException, .Remote, .RemoteException, java.rmi.server.RMIClientSocketFactory, .RMIServerSocketFactory, .UnicastRemoteObject, .RemoteObject, java.util.Map, .Collections, .Arrays, .Set, javax.security.auth.Subject, com.sun.jmx.remote.internal.rmi.RMIExporter, com.sun.jmx.remote.util.EnvHelp, java.util.stream.Collectors, sun.rmi.server.UnicastServerRef, .UnicastServerRef2, sun.rmi.transport.LiveRef

An 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.

Since
1.5
See Also
RMIServerImpl

Field Summary

Modifier and TypeField and Description
private final Set<String>
private final ObjectInputFilter
private final RMIClientSocketFactory
private final Map<String, ?>
private final ObjectInputFilter
private final int
private final RMIServerSocketFactory

Constructor Summary

AccessConstructor and Description
public
RMIJRMPServerImpl(int
the port on which this object and the RMIConnectionImpl objects it creates will be exported. Can be zero, to indicate any available port.
port
,
RMIClientSocketFactory
the client socket factory for the created RMI objects. Can be null.
csf
,
RMIServerSocketFactory
the server socket factory for the created RMI objects. Can be null.
ssf
,
Map<String, ?>
the environment map. Can be null.
env
)

Creates a new RMIServer object that will be exported on the given port using the given socket factories.

Method Summary

Modifier and TypeMethod and Description
protected void
closeClient(RMIConnection client)

Implements abstract javax.management.remote.rmi.RMIServerImpl.closeClient.

Closes a client connection made by makeClient.

protected void
closeServer()

Implements abstract javax.management.remote.rmi.RMIServerImpl.closeServer.

Called by close() to close the connector server by unexporting this object.

protected void
export()

Implements abstract javax.management.remote.rmi.RMIServerImpl.export.

Exports this RMI object.

private void
export(Remote obj, ObjectInputFilter typeFilter)

protected String
getProtocol()

Implements abstract javax.management.remote.rmi.RMIServerImpl.getProtocol.

Returns the protocol string for this object.

protected RMIConnection

Returns:

the newly-created RMIConnection.
makeClient
(String
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.
connectionId
,
Subject
the authenticated subject. Can be null.
subject
)

Implements abstract javax.management.remote.rmi.RMIServerImpl.makeClient.

Creates a new client connection as an RMI object exported through JRMP.

pack-priv ObjectInputFilter.Status

Returns:

ObjectInputFilter.Status.ALLOWED if the class is allowed, otherwise ObjectInputFilter.Status.REJECTED
newClientCheckInput
(ObjectInputFilter.FilterInfo filterInfo)

Check that a type in the remote invocation of RMIServerImpl#newClient is one of the allowedTypes.

public Remote

Returns:

a serializable stub.
toStub
()

Implements abstract javax.management.remote.rmi.RMIServerImpl.toStub.

Returns a serializable stub for this RMIServer object.

private void
unexport(Remote obj, boolean force)

Inherited from javax.management.remote.rmi.RMIServerImpl:
clientClosedclosedoNewClientgetDefaultClassLoadergetMBeanServergetNotifBuffergetVersionnewClientsetDefaultClassLoadersetMBeanServersetRMIConnectorServer

Field Detail

allowedTypesback to summary
private final Set<String> allowedTypes
cFilterback to summary
private final ObjectInputFilter cFilter
csfback to summary
private final RMIClientSocketFactory csf
envback to summary
private final Map<String, ?> env

Hides javax.management.remote.rmi.RMIServerImpl.env.

jmxRmiFilterback to summary
private final ObjectInputFilter jmxRmiFilter
portback to summary
private final int port
ssfback to summary
private final RMIServerSocketFactory ssf

Constructor Detail

RMIJRMPServerImplback to summary
public RMIJRMPServerImpl(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf, Map<String, ?> env) throws IOException

Creates a new RMIServer object that will be exported on the given port using the given socket factories.

Parameters
port:int

the port on which this object and the RMIConnectionImpl objects it creates will be exported. Can be zero, to indicate any available port.

csf:RMIClientSocketFactory

the client socket factory for the created RMI objects. Can be null.

ssf:RMIServerSocketFactory

the server socket factory for the created RMI objects. Can be null.

env:Map<String, ?>

the environment map. Can be null.

Exceptions
IOException:
if the RMIServer object cannot be created.
IllegalArgumentException:
if port is negative.

Method Detail

closeClientback to summary
protected void closeClient(RMIConnection client) throws IOException

Implements abstract javax.management.remote.rmi.RMIServerImpl.closeClient.

Doc from javax.management.remote.rmi.RMIServerImpl.closeClient.

Closes a client connection made by makeClient.

Exceptions
IOException:
if the client connection cannot be closed.
closeServerback to summary
protected void closeServer() throws IOException

Implements abstract javax.management.remote.rmi.RMIServerImpl.closeServer.

Called by close() to close the connector server by unexporting this object. After returning from this method, the connector server must not accept any new connections.

Exceptions
IOException:
if the attempt to close the connector server failed.
exportback to summary
protected void export() throws IOException

Implements abstract javax.management.remote.rmi.RMIServerImpl.export.

Doc from javax.management.remote.rmi.RMIServerImpl.export.

Exports this RMI object.

Exceptions
IOException:
if this RMI object cannot be exported.
exportback to summary
private void export(Remote obj, ObjectInputFilter typeFilter) throws RemoteException
getProtocolback to summary
protected String getProtocol()

Implements abstract javax.management.remote.rmi.RMIServerImpl.getProtocol.

Doc from javax.management.remote.rmi.RMIServerImpl.getProtocol.

Returns the protocol string for this object. The string is rmi for RMI/JRMP.

makeClientback to summary
protected RMIConnection makeClient(String connectionId, Subject subject) throws IOException

Implements abstract javax.management.remote.rmi.RMIServerImpl.makeClient.

Creates a new client connection as an RMI object exported through JRMP. The port and socket factories for the new RMIConnection object are the ones supplied to the RMIJRMPServerImpl constructor.

Parameters
connectionId:String

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.

subject:Subject

the authenticated subject. Can be null.

Returns:RMIConnection

the newly-created RMIConnection.

Exceptions
IOException:
if the new RMIConnection object cannot be created or exported.
newClientCheckInputback to summary
pack-priv ObjectInputFilter.Status newClientCheckInput(ObjectInputFilter.FilterInfo filterInfo)

Check that a type in the remote invocation of RMIServerImpl#newClient is one of the allowedTypes.

Returns:ObjectInputFilter.Status

ObjectInputFilter.Status.ALLOWED if the class is allowed, otherwise ObjectInputFilter.Status.REJECTED

toStubback to summary
public Remote toStub() throws IOException

Implements abstract javax.management.remote.rmi.RMIServerImpl.toStub.

Returns a serializable stub for this RMIServer object.

Returns:Remote

a serializable stub.

Exceptions
IOException:
if the stub cannot be obtained - e.g the RMIJRMPServerImpl has not been exported yet.
unexportback to summary
private void unexport(Remote obj, boolean force) throws NoSuchObjectException