javax.management.remote
Interface JMXConnectorServerMBean

All Known Implementing Classes:
JMXConnectorServer sample code for javax.management.remote.JMXConnectorServer definition code for javax.management.remote.JMXConnectorServer , RMIConnectorServer sample code for javax.management.remote.rmi.RMIConnectorServer definition code for javax.management.remote.rmi.RMIConnectorServer

public interface JMXConnectorServerMBean

MBean interface for connector servers. A JMX API connector server is attached to an MBean server, and establishes connections to that MBean server for remote clients.

A newly-created connector server is inactive, and does not yet listen for connections. Only when its start sample code for javax.management.remote.JMXConnectorServerMBean.start() definition code for javax.management.remote.JMXConnectorServerMBean.start() method has been called does it start listening for connections.

Since:
1.5

Method Summary
 JMXServiceURL sample code for javax.management.remote.JMXServiceURL definition code for javax.management.remote.JMXServiceURL getAddress sample code for javax.management.remote.JMXConnectorServerMBean.getAddress() definition code for javax.management.remote.JMXConnectorServerMBean.getAddress() ()
          The address of this connector server.
 Map sample code for java.util.Map definition code for java.util.Map <String sample code for java.lang.String definition code for java.lang.String ,?> getAttributes sample code for javax.management.remote.JMXConnectorServerMBean.getAttributes() definition code for javax.management.remote.JMXConnectorServerMBean.getAttributes() ()
          The attributes for this connector server.
 String sample code for java.lang.String definition code for java.lang.String [] getConnectionIds sample code for javax.management.remote.JMXConnectorServerMBean.getConnectionIds() definition code for javax.management.remote.JMXConnectorServerMBean.getConnectionIds() ()
          The list of IDs for currently-open connections to this connector server.
 boolean isActive sample code for javax.management.remote.JMXConnectorServerMBean.isActive() definition code for javax.management.remote.JMXConnectorServerMBean.isActive() ()
          Determines whether the connector server is active.
 void setMBeanServerForwarder sample code for javax.management.remote.JMXConnectorServerMBean.setMBeanServerForwarder(javax.management.remote.MBeanServerForwarder) definition code for javax.management.remote.JMXConnectorServerMBean.setMBeanServerForwarder(javax.management.remote.MBeanServerForwarder) (MBeanServerForwarder sample code for javax.management.remote.MBeanServerForwarder definition code for javax.management.remote.MBeanServerForwarder  mbsf)
          Adds an object that intercepts requests for the MBean server that arrive through this connector server.
 void start sample code for javax.management.remote.JMXConnectorServerMBean.start() definition code for javax.management.remote.JMXConnectorServerMBean.start() ()
          Activates the connector server, that is, starts listening for client connections.
 void stop sample code for javax.management.remote.JMXConnectorServerMBean.stop() definition code for javax.management.remote.JMXConnectorServerMBean.stop() ()
          Deactivates the connector server, that is, stops listening for client connections.
 JMXConnector sample code for javax.management.remote.JMXConnector definition code for javax.management.remote.JMXConnector toJMXConnector sample code for javax.management.remote.JMXConnectorServerMBean.toJMXConnector(java.util.Map) definition code for javax.management.remote.JMXConnectorServerMBean.toJMXConnector(java.util.Map) (Map sample code for java.util.Map definition code for java.util.Map <String sample code for java.lang.String definition code for java.lang.String ,?> env)
          Returns a client stub for this connector server.
 

Method Detail

start sample code for javax.management.remote.JMXConnectorServerMBean.start() definition code for javax.management.remote.JMXConnectorServerMBean.start()

void start()
           throws IOException sample code for java.io.IOException definition code for java.io.IOException 

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 IOException sample code for java.io.IOException definition code for java.io.IOException .

Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if it is not possible to start listening or if the connector server has been stopped.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the connector server has not been attached to an MBean server.

stop sample code for javax.management.remote.JMXConnectorServerMBean.stop() definition code for javax.management.remote.JMXConnectorServerMBean.stop()

void stop()
          throws IOException sample code for java.io.IOException definition code for java.io.IOException 

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 JMXConnectionNotification sample code for javax.management.remote.JMXConnectionNotification definition code for javax.management.remote.JMXConnectionNotification with type JMXConnectionNotification.FAILED sample code for javax.management.remote.JMXConnectionNotification.FAILED definition code for javax.management.remote.JMXConnectionNotification.FAILED is emitted from this MBean with the connection ID of the connection that could not be closed.

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.

Throws:
IOException sample code for java.io.IOException definition code for java.io.IOException - if the server cannot be closed cleanly. When this exception is thrown, the server has already attempted to close all client connections. All client connections are closed except possibly those that generated exceptions when the server attempted to close them.

isActive sample code for javax.management.remote.JMXConnectorServerMBean.isActive() definition code for javax.management.remote.JMXConnectorServerMBean.isActive()

boolean isActive()

Determines whether the connector server is active. A connector server starts being active when its start sample code for javax.management.remote.JMXConnectorServerMBean.start() definition code for javax.management.remote.JMXConnectorServerMBean.start() method returns successfully and remains active until either its stop sample code for javax.management.remote.JMXConnectorServerMBean.stop() definition code for javax.management.remote.JMXConnectorServerMBean.stop() method is called or the connector server fails.

Returns:
true if the connector server is active.

setMBeanServerForwarder sample code for javax.management.remote.JMXConnectorServerMBean.setMBeanServerForwarder(javax.management.remote.MBeanServerForwarder) definition code for javax.management.remote.JMXConnectorServerMBean.setMBeanServerForwarder(javax.management.remote.MBeanServerForwarder)

void setMBeanServerForwarder(MBeanServerForwarder sample code for javax.management.remote.MBeanServerForwarder definition code for javax.management.remote.MBeanServerForwarder  mbsf)

Adds an object that intercepts requests for the MBean server that arrive through this connector server. This object will be supplied as the MBeanServer for any new connection created by this connector server. Existing connections are unaffected.

If this connector server is already associated with an MBeanServer object, then that object is given to mbsf.setMBeanServer sample code for javax.management.remote.MBeanServerForwarder.setMBeanServer(javax.management.MBeanServer) definition code for javax.management.remote.MBeanServerForwarder.setMBeanServer(javax.management.MBeanServer) . If doing so produces an exception, this method throws the same exception without any other effect.

If this connector is not already associated with an MBeanServer object, or if the mbsf.setMBeanServer call just mentioned succeeds, then mbsf becomes this connector server's MBeanServer.

Parameters:
mbsf - the new MBeanServerForwarder.
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the call to mbsf.setMBeanServer sample code for javax.management.remote.MBeanServerForwarder.setMBeanServer(javax.management.MBeanServer) definition code for javax.management.remote.MBeanServerForwarder.setMBeanServer(javax.management.MBeanServer) fails with IllegalArgumentException. This includes the case where mbsf is null.

getConnectionIds sample code for javax.management.remote.JMXConnectorServerMBean.getConnectionIds() definition code for javax.management.remote.JMXConnectorServerMBean.getConnectionIds()

String sample code for java.lang.String definition code for java.lang.String [] getConnectionIds()

The list of IDs for currently-open connections to this connector server.

Returns:
a new string array containing the list of IDs. If there are no currently-open connections, this array will be empty.

getAddress sample code for javax.management.remote.JMXConnectorServerMBean.getAddress() definition code for javax.management.remote.JMXConnectorServerMBean.getAddress()

JMXServiceURL sample code for javax.management.remote.JMXServiceURL definition code for javax.management.remote.JMXServiceURL  getAddress()

The address of this connector server.

Returns:
the address of this connector server, or null if it does not have one.

getAttributes sample code for javax.management.remote.JMXConnectorServerMBean.getAttributes() definition code for javax.management.remote.JMXConnectorServerMBean.getAttributes()

Map sample code for java.util.Map definition code for java.util.Map <String sample code for java.lang.String definition code for java.lang.String ,?> getAttributes()

The attributes for this connector server.

Returns:
a read-only map containing the attributes for this connector server. Attributes whose values are not serializable are omitted from this map. If there are no serializable attributes, the returned map is empty.

toJMXConnector sample code for javax.management.remote.JMXConnectorServerMBean.toJMXConnector(java.util.Map<java.lang.String, ?>) definition code for javax.management.remote.JMXConnectorServerMBean.toJMXConnector(java.util.Map<java.lang.String, ?>)

JMXConnector sample code for javax.management.remote.JMXConnector definition code for javax.management.remote.JMXConnector  toJMXConnector(Map sample code for java.util.Map definition code for java.util.Map <String sample code for java.lang.String definition code for java.lang.String ,?> env)
                            throws IOException sample code for java.io.IOException definition code for java.io.IOException 

Returns a client stub for this connector server. A client stub is a serializable object whose connect sample code for javax.management.remote.JMXConnector.connect(java.util.Map) definition code for javax.management.remote.JMXConnector.connect(java.util.Map) method can be used to make one new connection to this connector server.

A given connector need not support the generation of client stubs. However, the connectors specified by the JMX Remote API do (JMXMP Connector and RMI Connector).

Parameters:
env - client connection parameters of the same sort that can be provided to JMXConnector.connect(Map) sample code for javax.management.remote.JMXConnector.connect(java.util.Map) definition code for javax.management.remote.JMXConnector.connect(java.util.Map) . Can be null, which is equivalent to an empty map.
Returns:
a client stub that can be used to make a new connection to this connector server.
Throws:
UnsupportedOperationException sample code for java.lang.UnsupportedOperationException definition code for java.lang.UnsupportedOperationException - if this connector server does not support the generation of client stubs.
IllegalStateException sample code for java.lang.IllegalStateException definition code for java.lang.IllegalStateException - if the JMXConnectorServer is not started (see isActive() sample code for javax.management.remote.JMXConnectorServerMBean.isActive() definition code for javax.management.remote.JMXConnectorServerMBean.isActive() ).
IOException sample code for java.io.IOException definition code for java.io.IOException - if a communications problem means that a stub cannot be created.