mx4j.tools.remote

Class AbstractJMXConnector

Implemented Interfaces:
javax.management.remote.JMXConnector, Serializable
Known Direct Subclasses:
HTTPConnector, LocalConnector

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.
Version:
$Revision: 1.8 $

Fields inherited from interface javax.management.remote.JMXConnector

CREDENTIALS

Constructor Summary

AbstractJMXConnector(javax.management.remote.JMXServiceURL address)
Creates a new JMXConnector that will connect to the given JMXServiceURL

Method Summary

void
addConnectionNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, Object handback)
void
close()
void
connect()
void
connect(Map environment)
protected ConnectionNotificationEmitter
createConnectionNotificationEmitter()
Creates a notification emitter used to emit connection notifications.
protected abstract void
doClose()
Template method to be implemented by subclasses to close this JMXConnector
protected abstract void
doConnect(Map environment)
protected abstract javax.management.MBeanServerConnection
doGetMBeanServerConnection(Subject delegate)
Template method to be implemented by subclasses to return an MBeanServerConnection for the given delegate subject.
protected javax.management.remote.JMXServiceURL
getAddress()
Returns the JMXServiceURL this JMXConnector will connect to.
protected ConnectionNotificationEmitter
getConnectionNotificationEmitter()
javax.management.MBeanServerConnection
getMBeanServerConnection()
javax.management.MBeanServerConnection
getMBeanServerConnection(Subject delegate)
protected boolean
isClosed()
Returns whether the close() method has been called.
protected boolean
isConnected()
Returns whether the connect or connect(Map) method has been called on this JMXConnector.
void
removeConnectionNotificationListener(javax.management.NotificationListener listener)
void
removeConnectionNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, Object handback)
protected void
sendConnectionNotificationClosed()

Constructor Details

AbstractJMXConnector

protected AbstractJMXConnector(javax.management.remote.JMXServiceURL address)
            throws IOException
Creates a new JMXConnector that will connect to the given JMXServiceURL

Method Details

addConnectionNotificationListener

public void addConnectionNotificationListener(javax.management.NotificationListener listener,
                                              javax.management.NotificationFilter filter,
                                              Object handback)
Specified by:
addConnectionNotificationListener in interface javax.management.remote.JMXConnector

close

public void close()
            throws IOException
Specified by:
close in interface javax.management.remote.JMXConnector

connect

public void connect()
            throws IOException,
                   SecurityException
Specified by:
connect in interface javax.management.remote.JMXConnector

connect

public void connect(Map environment)
            throws IOException,
                   SecurityException
Specified by:
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.

getConnectionNotificationEmitter

protected ConnectionNotificationEmitter getConnectionNotificationEmitter()

getMBeanServerConnection

public javax.management.MBeanServerConnection getMBeanServerConnection()
            throws IOException
Specified by:
getMBeanServerConnection in interface javax.management.remote.JMXConnector

getMBeanServerConnection

public javax.management.MBeanServerConnection getMBeanServerConnection(Subject delegate)
            throws IOException
Specified by:
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
Specified by:
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
Specified by:
removeConnectionNotificationListener in interface javax.management.remote.JMXConnector

sendConnectionNotificationClosed

protected void sendConnectionNotificationClosed()

Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.