Class: javax.management.remote.rmi.RMIServerImpl
An RMI object representing a connector server. Remote clients can make connections using the javax.management.remote.rmi.RMIServerImpl.newClient(java.lang.Object) method. This method returns an RMI object representing the connection.
User code does not usually reference this class directly. RMI connection servers are usually created with the class javax.management.remote.rmi.RMIConnectorServer. Remote clients usually create connections either with javax.management.remote.JMXConnectorFactory or by instantiating javax.management.remote.rmi.RMIConnector.
This is an abstract class. Concrete subclasses define the details of the client connection objects, such as whether they use JRMP or IIOP.
Methods
-
RMIServerImpltop
public RMIServerImpl(Map<?> env)Constructs a new
RMIServerImpl. -
clientClosedtop
protected void clientClosed(RMIConnection client) throws IOExceptionMethod called when a client connection created by makeClient is closed. A subclass that defines
makeClientmust arrange for this method to be called when the resultant object's close method is called. This enables it to be removed from theRMIServerImpl's list of connections. It is not an error forclientnot to be in that list.After removing
clientfrom the list of connections, this method calls closeClient(client). -
closetop
public synchronized void close() throws IOExceptionCloses this connection server. This method first calls the javax.management.remote.rmi.RMIServerImpl.closeServer() method so that no new client connections will be accepted. Then, for each remaining javax.management.remote.rmi.RMIConnection object returned by makeClient, its close method is called.
The behavior when this method is called more than once is unspecified.
If javax.management.remote.rmi.RMIServerImpl.closeServer() throws an
IOException, the individual connections are nevertheless closed, and then theIOExceptionis thrown from this method.If javax.management.remote.rmi.RMIServerImpl.closeServer() returns normally but one or more of the individual connections throws an
IOException, then, after closing all the connections, one of thoseIOExceptions is thrown from this method. If more than one connection throws anIOException, it is unspecified which one is thrown from this method. -
closeClienttop
abstract protected void closeClient(RMIConnection client) throws IOExceptionCloses a client connection made by makeClient.
-
closeServertop
abstract protected void closeServer() throws IOExceptionCalled by javax.management.remote.rmi.RMIServerImpl.close() to close the connector server. After returning from this method, the connector server must not accept any new connections.
-
exporttop
abstract protected void export() throws IOExceptionExports this RMI object.
-
getDefaultClassLoadertop
public synchronized ClassLoader getDefaultClassLoader()Gets the default
ClassLoaderused by this connector server. -
getMBeanServertop
public synchronized MBeanServer getMBeanServer()The
MBeanServerto which this connector server is attached. This is the last value passed to javax.management.remote.rmi.RMIServerImpl.setMBeanServer(javax.management.MBeanServer) on this object, or null if that method has never been called. -
getProtocoltop
abstract protected String getProtocol()Returns the protocol string for this object. The string is
rmifor RMI/JRMP andiiopfor RMI/IIOP. -
getVersiontop
public String getVersion()The version of the RMI Connector Protocol understood by this connector server. This is a string with the following format:
protocol-version implementation-name
The
protocol-versionis a series of two or more non-negative integers separated by periods (.). An implementation of the version described by this documentation must use the string1.0here.After the protocol version there must be a space, followed by the implementation name. The format of the implementation name is unspecified. It is recommended that it include an implementation version number. An implementation can use an empty string as its implementation name, for example for security reasons.
- Specified by:
- getVersion from RMIServer
-
makeClienttop
abstract protected RMIConnection makeClient(String connectionId, Subject subject) throws IOExceptionCreates a new client connection. This method is called by the public method javax.management.remote.rmi.RMIServerImpl.newClient(java.lang.Object).
-
newClienttop
Creates a new client connection. This method calls makeClient and adds the returned client connection object to an internal list. When this
RMIServerImplis shut down via its javax.management.remote.rmi.RMIServerImpl.close() method, the close() method of each object remaining in the list is called.The fact that a client connection object is in this internal list does not prevent it from being garbage collected.
-
setDefaultClassLoadertop
public synchronized void setDefaultClassLoader(ClassLoader cl)Sets the default
ClassLoaderfor this connector server. New client connections will use this classloader. Existing client connections are unaffected. -
setMBeanServertop
public synchronized void setMBeanServer(MBeanServer mbs)Sets the
MBeanServerto which this connector server is attached. New client connections will interact with thisMBeanServer. Existing client connections are unaffected. -
toStubtop
public abstract Remote toStub() throws IOExceptionReturns a remotable stub for this server object.
