public abstract class AbstractJMXConnector
extends java.lang.Object
implements javax.management.remote.JMXConnector, Serializable
Abstract implementation of the JMXConnector interface.
It gives support for emitting connection notifications and implements JMXConnector methods
using the template method pattern.
addConnectionNotificationListener
public void addConnectionNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
Object handback)
- addConnectionNotificationListener in interface javax.management.remote.JMXConnector
close
public void close()
throws IOException
- close in interface javax.management.remote.JMXConnector
connect
public void connect()
throws IOException,
SecurityException
- connect in interface javax.management.remote.JMXConnector
connect
public void connect(Map environment)
throws IOException,
SecurityException
- connect in interface javax.management.remote.JMXConnector
createConnectionNotificationEmitter
protected ConnectionNotificationEmitter createConnectionNotificationEmitter()
Creates a notification emitter used to emit connection notifications.
This method is called once per JMXConnector.
doClose
protected abstract void doClose()
throws IOException
Template method to be implemented by subclasses to close this JMXConnector
doConnect
protected abstract void doConnect(Map environment)
throws IOException,
SecurityException
doGetMBeanServerConnection
protected abstract javax.management.MBeanServerConnection doGetMBeanServerConnection(Subject delegate)
throws IOException
Template method to be implemented by subclasses to return an MBeanServerConnection
for the given delegate subject.
This method should return an MBeanServerConnection that delegates method calls to a
JMXConnection
(or an equivalent client side connection object).
The JMXConnection object to which calls are delegated can in turn be a chain of
objects that decorate the call performing some other operation; the final object in
the chain is the one that really communicates with the server side, and it is normally
called
ClientInvoker.
getAddress
protected javax.management.remote.JMXServiceURL getAddress()
Returns the JMXServiceURL this JMXConnector will connect to.
getMBeanServerConnection
public javax.management.MBeanServerConnection getMBeanServerConnection()
throws IOException
- getMBeanServerConnection in interface javax.management.remote.JMXConnector
getMBeanServerConnection
public javax.management.MBeanServerConnection getMBeanServerConnection(Subject delegate)
throws IOException
- getMBeanServerConnection in interface javax.management.remote.JMXConnector
isClosed
protected boolean isClosed()
Returns whether the
close()
method has been called.
isConnected
protected boolean isConnected()
Returns whether the
connect
or
connect(Map)
method has been called on this JMXConnector.
removeConnectionNotificationListener
public void removeConnectionNotificationListener(javax.management.NotificationListener listener)
throws javax.management.ListenerNotFoundException
- removeConnectionNotificationListener in interface javax.management.remote.JMXConnector
removeConnectionNotificationListener
public void removeConnectionNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
Object handback)
throws javax.management.ListenerNotFoundException
- removeConnectionNotificationListener in interface javax.management.remote.JMXConnector
sendConnectionNotificationClosed
protected void sendConnectionNotificationClosed()