A JMX API connector server that creates RMI-based connections
from remote clients. Usually, such connector servers are made
using JMXConnectorServerFactory. However, specialized applications can
use this class directly, for example with an RMIServerImpl
object.
| Modifier and Type | Field and Description |
|---|---|
| private JMXServiceURL | |
| private final Map | |
| private String | |
| private static final int | |
| public static final String | CREDENTIALS_FILTER_PATTERN
Name of the attribute that specifies an
|
| private ClassLoader | |
| private static final char[] | intToAlpha
This array is a lookup table that translates 6-bit positive integer index values into their "Base64 Alphabet" equivalents as specified in Table 1 of RFC 2045. |
| public static final String | JNDI_REBIND_ATTRIBUTE
Name of the attribute that specifies whether the |
| private static ClassLogger | |
| private static final Set | |
| public static final String | RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE
Name of the attribute that specifies the |
| public static final String | RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE
Name of the attribute that specifies the |
| private RMIServerImpl | |
| public static final String | SERIAL_FILTER_PATTERN
This attribute defines a pattern from which to create a
|
| private static final int | |
| private int | |
| private static final int |
| Access | Constructor and Description |
|---|---|
| public | RMIConnectorServer(JMXServiceURL
the URL defining how to create the connector server.
Cannot be null. url, Map<String, ?> attributes governing the creation and
storing of the RMI object. Can be null, which is equivalent to
an empty Map. environment)Makes an |
| public | RMIConnectorServer(JMXServiceURL
the URL defining how to create the connector server.
Cannot be null. url, Map<String, ?> attributes governing the creation and
storing of the RMI object. Can be null, which is equivalent to
an empty Map. environment, MBeanServer the MBean server to which the new connector
server is attached, or null if it will be attached by being
registered as an MBean in the MBean server. mbeanServer)Makes an |
| public | RMIConnectorServer(JMXServiceURL
the URL defining how to create the connector server.
Cannot be null. url, Map<String, ?> attributes governing the creation and
storing of the RMI object. Can be null, which is equivalent to
an empty Map. environment, RMIServerImpl An implementation of the RMIServer interface,
consistent with the protocol type specified in url.
If this parameter is non null, the protocol type specified by
url is not constrained, and is assumed to be valid.
Otherwise, only "rmi" will be recognized. rmiServerImpl, MBeanServer the MBean server to which the new connector
server is attached, or null if it will be attached by being
registered as an MBean in the MBean server. mbeanServer)Makes an |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | bind(String
URL of the stub in the registry, extracted
from the jndiUrl, Hashtable<?, ?> JMXServiceURL.A Hashtable containing environment parameters,
built from the Map specified at this object creation. attributes, RMIServer The object to bind in the registry rmiServer, boolean true if the object must be rebound. rebind)Bind a stub to a registry. |
| private static String | |
| protected void | connectionClosed(String connectionId, String message, Object userData)
Overrides javax. Called by a subclass when a client connection is closed normally. |
| protected void | connectionFailed(String connectionId, String message, Object userData)
Overrides javax. Called by a subclass when a client connection fails. |
| protected void | connectionOpened(String connectionId, String message, Object userData)
Overrides javax. Called by a subclass when a new client connection is opened. |
| pack-priv static String | |
| pack-priv static String | |
| private void | encodeStubInAddress(RMIServer
The stub object to encode in the URL rmiServer, Map<String, ?> A Map containing environment parameters,
built from the Map specified at this object creation. attributes)Encode a stub into the JMXServiceURL. |
| public JMXServiceURL | getAddress()
Implements javax. The address of this connector server. |
| public Map | getAttributes()
Implements javax. The attributes for this connector server. |
| public synchronized boolean | isActive()
Implements javax. Determines whether the connector server is active. |
| private static IOException | |
| private static RMIServerImpl | |
| pack-priv RMIServerImpl | |
| private static RMIServer | |
| public synchronized void | setMBeanServerForwarder(MBeanServerForwarder mbsf)
Overrides javax. Implements javax. Inserts an object that intercepts requests for the MBean server that arrive through this connector server. |
| public synchronized void | start()
Implements javax. Activates the connector server, that is starts listening for client connections. |
| public void | stop()
Implements javax. Deactivates the connector server, that is, stops listening for client connections. |
| public JMXConnector | Returns: a client stub that can be used to make a new connection to this connector server.client connection parameters of the same sort that
could be provided to env)JMXConnector.. Can be null, which is equivalent
to an empty map.Overrides javax. Implements javax. Returns a client stub for this connector server. |
| address | back to summary |
|---|---|
| private JMXServiceURL address | |
| attributes | back to summary |
|---|---|
| private final Map<String, ?> attributes | |
| boundJndiUrl | back to summary |
|---|---|
| private String boundJndiUrl | |
| CREATED | back to summary |
|---|---|
| private static final int CREATED | |
| CREDENTIALS_FILTER_PATTERN | back to summary |
|---|---|
| public static final String CREDENTIALS_FILTER_PATTERN Name of the attribute that specifies an
The filter pattern must be in same format as used in
This list of classes allowed by filter should correspond to the transitive closure of the credentials class (or classes) used by the installed JMXAuthenticator associated with the RMIServer implementation. If the attribute is not set then any class is deemed acceptable.
| |
| defaultClassLoader | back to summary |
|---|---|
| private ClassLoader defaultClassLoader | |
| intToAlpha | back to summary |
|---|---|
| private static final char[] intToAlpha This array is a lookup table that translates 6-bit positive integer index values into their "Base64 Alphabet" equivalents as specified in Table 1 of RFC 2045. | |
| JNDI_REBIND_ATTRIBUTE | back to summary |
|---|---|
| public static final String JNDI_REBIND_ATTRIBUTE Name of the attribute that specifies whether the | |
| logger | back to summary |
|---|---|
| private static ClassLogger logger Hides javax. | |
| openedServers | back to summary |
|---|---|
| private static final Set<RMIConnectorServer> openedServers | |
| RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE | back to summary |
|---|---|
| public static final String RMI_CLIENT_SOCKET_FACTORY_ATTRIBUTE Name of the attribute that specifies the | |
| RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE | back to summary |
|---|---|
| public static final String RMI_SERVER_SOCKET_FACTORY_ATTRIBUTE Name of the attribute that specifies the | |
| rmiServerImpl | back to summary |
|---|---|
| private RMIServerImpl rmiServerImpl | |
| SERIAL_FILTER_PATTERN | back to summary |
|---|---|
| public static final String SERIAL_FILTER_PATTERN This attribute defines a pattern from which to create a
The filter will be called for any class found in the serialized
stream sent to server by client, including all JMX defined classes
(such as
To be functional, the filter should allow at least all the
concrete types in the transitive closure of all objects that
might get serialized when serializing all JMX classes referred
as parameters in the
Care must be taken when defining such a filter, as defining
an allow-list that is too narrow or a reject-list that is too wide may
prevent legitimate clients from interoperating with the
| |
| STARTED | back to summary |
|---|---|
| private static final int STARTED | |
| state | back to summary |
|---|---|
| private int state | |
| STOPPED | back to summary |
|---|---|
| private static final int STOPPED | |
| RMIConnectorServer | back to summary |
|---|---|
| public RMIConnectorServer(JMXServiceURL url, Map<String, ?> environment) throws IOException Makes an
| |
| RMIConnectorServer | back to summary |
|---|---|
| public RMIConnectorServer(JMXServiceURL url, Map<String, ?> environment, MBeanServer mbeanServer) throws IOException Makes an
| |
| RMIConnectorServer | back to summary |
|---|---|
| public RMIConnectorServer(JMXServiceURL url, Map<String, ?> environment, RMIServerImpl rmiServerImpl, MBeanServer mbeanServer) throws IOException Makes an
| |
| bind | back to summary |
|---|---|
| pack-priv void bind(String jndiUrl, Hashtable<?, ?> attributes, RMIServer rmiServer, boolean rebind) throws NamingException, MalformedURLException Bind a stub to a registry.
| |
| byteArrayToBase64 | back to summary |
|---|---|
| private static String byteArrayToBase64(byte[] a) | |
| connectionClosed | back to summary |
|---|---|
| protected void connectionClosed(String connectionId, String message, Object userData) Overrides javax. Doc from javax. Called by a subclass when a client connection is closed
normally. Removes
| |
| connectionFailed | back to summary |
|---|---|
| protected void connectionFailed(String connectionId, String message, Object userData) Overrides javax. Doc from javax. Called by a subclass when a client connection fails.
Removes
| |
| connectionOpened | back to summary |
|---|---|
| protected void connectionOpened(String connectionId, String message, Object userData) Overrides javax. Doc from javax. Called by a subclass when a new client connection is opened.
Adds
| |
| encodeJRMPStub | back to summary |
|---|---|
| pack-priv static String encodeJRMPStub(RMIServer rmiServer, Map<String, ?> env) throws IOException | |
| encodeStub | back to summary |
|---|---|
| pack-priv static String encodeStub(RMIServer rmiServer, Map<String, ?> env) throws IOException Returns the IOR of the given rmiServer. | |
| encodeStubInAddress | back to summary |
|---|---|
| private void encodeStubInAddress(RMIServer rmiServer, Map<String, ?> attributes) throws IOException Encode a stub into the JMXServiceURL. | |
| getAddress | back to summary |
|---|---|
| public JMXServiceURL getAddress() Implements javax. Doc from javax. The address of this connector server.
The address returned may not be the exact original Note that the address returned may be | |
| getAttributes | back to summary |
|---|---|
| public Map Implements javax. Doc from javax. The attributes for this connector server. | |
| isActive | back to summary |
|---|---|
| public synchronized boolean isActive() Implements javax. Doc from javax. Determines whether the connector server is active. A connector
server starts being active when its | |
| newIOException | back to summary |
|---|---|
| private static IOException newIOException(String message, Throwable cause) Construct a new IOException with a nested exception. The nested exception is set only if JDK >= 1.4 | |
| newJRMPServer | back to summary |
|---|---|
| private static RMIServerImpl newJRMPServer(Map<String, ?> env, int port) throws IOException | |
| newServer | back to summary |
|---|---|
| pack-priv RMIServerImpl newServer() throws IOException Creates a new RMIServerImpl. | |
| objectToBind | back to summary |
|---|---|
| private static RMIServer objectToBind(RMIServerImpl rmiServer, Map<String, ?> env) throws IOException Object that we will bind to the registry. This object is a stub connected to our RMIServerImpl. | |
| setMBeanServerForwarder | back to summary |
|---|---|
| public synchronized void setMBeanServerForwarder(MBeanServerForwarder mbsf) Overrides javax. Implements javax. Doc from javax. Inserts an object that intercepts requests for the MBean server
that arrive through this connector server. This object will be
supplied as the This method can be called more than once with different
| |
| start | back to summary |
|---|---|
| public synchronized void start() throws IOException Implements javax. Activates the connector server, that is starts listening for
client connections. Calling this method when the connector
server is already active has no effect. Calling this method
when the connector server has been stopped will generate an
The behavior of this method when called for the first time depends on the parameters that were supplied at construction, as described below. First, an object of a subclass of
If the given address includes a JNDI directory URL as
specified in the package documentation for If the URL path part of the The behavior when the URL path is neither empty nor a JNDI
directory URL, or when the protocol is not
| |
| stop | back to summary |
|---|---|
| public void stop() throws IOException Implements javax. Deactivates the connector server, that is, stops listening for client connections. Calling this method will also close all client connections that were made by this server. After this method returns, whether normally or with an exception, the connector server will not create any new client connections. Once a connector server has been stopped, it cannot be started again. Calling this method when the connector server has already been stopped has no effect. Calling this method when the connector server has not yet been started will disable the connector server object permanently. If closing a client connection produces an exception, that
exception is not thrown from this method. A Closing a connector server is a potentially slow operation. For example, if a client machine with an open connection has crashed, the close operation might have to wait for a network protocol timeout. Callers that do not want to block in a close operation should do it in a separate thread. This method calls the method If the
| |
| toJMXConnector | back to summary |
|---|---|
| public JMXConnector toJMXConnector(Map<String, ?> env) throws IOException Overrides javax. Implements javax. Returns a client stub for this connector server. A client
stub is a serializable object whose
| |