Superclass of every connector server. A connector server is attached to an MBean server. It listens for client connection requests and creates a connection for each one.
A connector server is associated with an MBean server either by registering it in that MBean server, or by passing the MBean server to its constructor.
A connector server is inactive when created. It only starts
listening for client connections when the start
method is called. A connector server stops listening for client
connections when the stop
method is called or when
the connector server is unregistered from its MBean server.
Stopping a connector server does not unregister it from its MBean server. A connector server once stopped cannot be restarted.
Each time a client connection is made or broken, a notification
of class JMXConnectionNotification
is emitted.
Modifier and Type | Field and Description |
---|---|
public static final String | AUTHENTICATOR
Name of the attribute that specifies the authenticator for a connector server. |
private final List | |
private MBeanServer | mbeanServer
The MBeanServer used by this server to execute a client request. |
private ObjectName | myName
The name used to registered this server in an MBeanServer. |
private static long | |
private static final int[] |
Access | Constructor and Description |
---|---|
public | JMXConnectorServer()
Constructs a connector server that will be registered as an MBean in the MBean server it is attached to. |
public | JMXConnectorServer(MBeanServer
the MBean server that this connector server
is attached to. Null if this connector server will be attached
to an MBean server by being registered in it. mbeanServer)Constructs a connector server that is attached to the given MBean server. |
Modifier and Type | Method and Description |
---|---|
protected void | connectionClosed(String
the ID of the closed connection. connectionId, String the message for the emitted message, Object JMXConnectionNotification . Can be null. See Notification#getMessage() .the userData)userData for the emitted
JMXConnectionNotification . Can be null. See Notification#getUserData() .Called by a subclass when a client connection is closed normally. |
protected void | connectionFailed(String
the ID of the failed connection. connectionId, String the message for the emitted message, Object JMXConnectionNotification . Can be null. See Notification#getMessage() .the userData)userData for the emitted
JMXConnectionNotification . Can be null. See Notification#getUserData() .Called by a subclass when a client connection fails. |
protected void | connectionOpened(String
the ID of the new connection. This must be
different from the ID of any connection previously opened by
this connector server. connectionId, String the message for the emitted message, Object JMXConnectionNotification . Can be null. See Notification#getMessage() .the userData)userData for the emitted
JMXConnectionNotification . Can be null. See Notification#getUserData() .Called by a subclass when a new client connection is opened. |
public String[] | getConnectionIds()
Implements javax. The list of IDs for currently-open connections to this connector server. |
public synchronized MBeanServer | Returns: the MBean server that this connector server is attached to, or null if it is not yet attached to an MBean server.Returns the MBean server that this connector server is attached to. |
public MBeanNotificationInfo[] | Returns: the array of possible notifications.Overrides javax. Implements javax. Returns an array indicating the notifications that this MBean sends. |
private synchronized Object | |
private static long | |
public void | postDeregister()
Implements javax. Allows the MBean to perform any operations needed after having been unregistered in the MBean server. |
public void | postRegister(Boolean
Indicates whether or not the MBean has
been successfully registered in the MBean server. The value
false means that the registration phase has failed. registrationDone)Implements javax. Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed. |
public synchronized void | preDeregister()
Implements javax. Called by an MBean server when this connector server is unregistered from that MBean server. |
public synchronized ObjectName | Returns: The name under which the MBean is to be registered.the MBean server in which this connection server is
being registered. mbs, ObjectName The object name of the MBean. name)Implements javax. Called by an MBean server when this connector server is registered in that MBean server. |
private void | |
public synchronized void | setMBeanServerForwarder(MBeanServerForwarder
the new mbsf)MBeanServerForwarder .Implements javax. Inserts an object that intercepts requests for the MBean server that arrive through this connector server. |
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.Implements javax. Returns a client stub for this connector server. |
AUTHENTICATOR | back to summary |
---|---|
public static final String AUTHENTICATOR Name of the attribute that specifies the authenticator for a
connector server. The value associated with this attribute, if
any, must be an object that implements the interface |
connectionIds | back to summary |
---|---|
private final List<String> connectionIds |
mbeanServer | back to summary |
---|---|
private MBeanServer mbeanServer The MBeanServer used by this server to execute a client request. |
myName | back to summary |
---|---|
private ObjectName myName The name used to registered this server in an MBeanServer. It is null if the this server is not registered or has been unregistered. |
sequenceNumber | back to summary |
---|---|
private static long sequenceNumber |
sequenceNumberLock | back to summary |
---|---|
private static final int[] sequenceNumberLock |
JMXConnectorServer | back to summary |
---|---|
public JMXConnectorServer() Constructs a connector server that will be registered as an
MBean in the MBean server it is attached to. This constructor
is typically called by one of the |
JMXConnectorServer | back to summary |
---|---|
public JMXConnectorServer(MBeanServer mbeanServer) Constructs a connector server that is attached to the given MBean server. A connector server that is created in this way can be registered in a different MBean server, or not registered in any MBean server.
|
connectionClosed | back to summary |
---|---|
protected void connectionClosed(String connectionId, String message, Object userData) 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) Called by a subclass when a client connection fails.
Removes
|
connectionOpened | back to summary |
---|---|
protected void connectionOpened(String connectionId, String message, Object userData) Called by a subclass when a new client connection is opened.
Adds
|
getConnectionIds | back to summary |
---|---|
public String[] getConnectionIds() Implements javax. Doc from javax. The list of IDs for currently-open connections to this connector server.
|
getMBeanServer | back to summary |
---|---|
public synchronized MBeanServer getMBeanServer() Returns the MBean server that this connector server is attached to.
|
getNotificationInfo | back to summary |
---|---|
public MBeanNotificationInfo[] getNotificationInfo() Overrides javax. Implements javax. Returns an array indicating the notifications that this MBean
sends. The implementation in
|
getNotificationSource | back to summary |
---|---|
private synchronized Object getNotificationSource() |
nextSequenceNumber | back to summary |
---|---|
private static long nextSequenceNumber() |
postDeregister | back to summary |
---|---|
public void postDeregister() Implements javax. Doc from javax. Allows the MBean to perform any operations needed after having been unregistered in the MBean server. If the implementation of this method throws a This might be confusing for the code calling
|
postRegister | back to summary |
---|---|
public void postRegister(Boolean registrationDone) Implements javax. Doc from javax. Allows the MBean to perform any operations needed after having been registered in the MBean server or after the registration has failed. If the implementation of this method throws a This might be confusing for the code calling
|
preDeregister | back to summary |
---|---|
public synchronized void preDeregister() throws Exception Implements javax. Called by an MBean server when this connector server is
unregistered from that MBean server. If this connector server
was attached to that MBean server by being registered in it,
and if the connector server is still active,
then unregistering it will call the
|
preRegister | back to summary |
---|---|
public synchronized ObjectName preRegister(MBeanServer mbs, ObjectName name) Implements javax. Called by an MBean server when this connector server is
registered in that MBean server. This connector server becomes
attached to the MBean server and its If this connector server is already attached to an MBean server, this method has no effect. The MBean server it is attached to is not necessarily the one it is being registered in.
|
sendNotification | back to summary |
---|---|
private void sendNotification(String type, String connectionId, String message, Object userData) |
setMBeanServerForwarder | back to summary |
---|---|
public synchronized void setMBeanServerForwarder(MBeanServerForwarder mbsf) 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
|
toJMXConnector | back to summary |
---|---|
public JMXConnector toJMXConnector(Map<String, ?> env) throws IOException Implements javax. Returns a client stub for this connector server. A client
stub is a serializable object whose 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). The default implementation of this method uses JMXServiceURL addr = A connector server for which this is inappropriate must
override this method so that it either implements the
appropriate logic or throws
|