public class GenericConnector extends Object implements JMXConnector
A client connection to a remote JMX API server. This class can
use a MessageConnection object to specify the transport for
communicating with the server.
User code does not usually instantiate this class. Instead, a
JMXConnectorProvider should be added to the JMXConnectorFactory so that users can implicitly instantiate the
GenericConnector (or a subclass of it) through the JMXServiceURL provided when connecting.
The specific connector protocol to be used by an instance of
this class is specified by attributes in the Map
passed to the constructor or the connect
method. The attribute MESSAGE_CONNECTION is the standard
way to define the transport. An implementation can recognize other
attributes to define the transport differently.
| Modifier and Type | Field and Description |
|---|---|
static String |
MESSAGE_CONNECTION
Name of the attribute that specifies how this connector
sends messages to its connector server.
|
static String |
OBJECT_WRAPPING
Name of the attribute that specifies the object wrapping for
parameters whose deserialization requires special treatment.
|
CREDENTIALS| Constructor and Description |
|---|
GenericConnector()
Default no-arg constructor.
|
GenericConnector(Map env)
Constructor specifying connection attributes.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback) |
void |
close() |
void |
connect() |
void |
connect(Map env) |
String |
getConnectionId() |
MBeanServerConnection |
getMBeanServerConnection() |
MBeanServerConnection |
getMBeanServerConnection(Subject delegationSubject) |
void |
removeConnectionNotificationListener(NotificationListener listener) |
void |
removeConnectionNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback) |
protected void |
sendNotification(Notification n)
Send a notification to the connection listeners.
|
public static final String OBJECT_WRAPPING
Name of the attribute that specifies the object wrapping for
parameters whose deserialization requires special treatment.
The value associated with this attribute, if any, must be an
object that implements the interface ObjectWrapping.
public static final String MESSAGE_CONNECTION
Name of the attribute that specifies how this connector
sends messages to its connector server. The value associated
with this attribute, if any, must be an object that implements
the interface MessageConnection.
public GenericConnector()
Default no-arg constructor.
public GenericConnector(Map env)
Constructor specifying connection attributes.
env - the attributes of the connection.public void connect()
throws IOException
connect in interface JMXConnectorIOExceptionpublic void connect(Map env) throws IOException
connect in interface JMXConnectorIOExceptionpublic String getConnectionId() throws IOException
getConnectionId in interface JMXConnectorIOExceptionpublic MBeanServerConnection getMBeanServerConnection() throws IOException
getMBeanServerConnection in interface JMXConnectorIOExceptionpublic MBeanServerConnection getMBeanServerConnection(Subject delegationSubject) throws IOException
getMBeanServerConnection in interface JMXConnectorIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in interface JMXConnectorIOExceptionpublic void addConnectionNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
addConnectionNotificationListener in interface JMXConnectorpublic void removeConnectionNotificationListener(NotificationListener listener) throws ListenerNotFoundException
removeConnectionNotificationListener in interface JMXConnectorListenerNotFoundExceptionpublic void removeConnectionNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
removeConnectionNotificationListener in interface JMXConnectorListenerNotFoundExceptionprotected void sendNotification(Notification n)
Send a notification to the connection listeners. The
notification will be sent to every listener added with addConnectionNotificationListener that was not subsequently
removed by a removeConnectionNotificationListener,
provided the corresponding NotificationFilter
matches.
n - the notification to send. This will usually be a
JMXConnectionNotification, but an implementation can
send other notifications as well.Copyright © 2019 Terracotta, Inc.. All rights reserved.