Package com.adaptris.jmx.remote.jms
Class JmsJmxConnectorClient
- java.lang.Object
-
- com.adaptris.jmx.remote.jms.JmsJmxConnectorClient
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,javax.management.remote.JMXConnector
public class JmsJmxConnectorClient extends java.lang.Object implements javax.management.remote.JMXConnector
Implementation ofJMXConnector
that provides JMX connectivity via JMS.It is expected that this class will be constructed using
JMXConnectorFactory.newJMXConnector(JMXServiceURL, Map)
; rather than directly via the constructor. As the various provider (e.g.com.adaptris.jmx.remote.provider.activemq.ClientProvider
) will initialise the various connection properties that are required for connecting to the JMS provider, effectively theconnect(Map)
method will not override any properties that have already been set in the initial set of attributes.Note that the
getConnectionId()
returned by this client is auto-generated upon each new connection attempt. It will not correspond to any information that can be retrieved from the correspondingJmsJmxConnectorServer
.
-
-
Constructor Summary
Constructors Constructor Description JmsJmxConnectorClient(javax.management.remote.JMXServiceURL url, java.util.Map<java.lang.String,?> env, JmsJmxConnectionFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConnectionNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
void
close()
void
connect()
Establishes the connection to the connector server.void
connect(java.util.Map env)
Establishes the connection to the connector server.java.lang.String
getConnectionId()
javax.management.MBeanServerConnection
getMBeanServerConnection()
javax.management.MBeanServerConnection
getMBeanServerConnection(javax.security.auth.Subject delegationSubject)
Note that this is unsupported and will throw anUnsupportedOperationException
.void
removeConnectionNotificationListener(javax.management.NotificationListener listener)
void
removeConnectionNotificationListener(javax.management.NotificationListener l, javax.management.NotificationFilter f, java.lang.Object handback)
-
-
-
Constructor Detail
-
JmsJmxConnectorClient
public JmsJmxConnectorClient(javax.management.remote.JMXServiceURL url, java.util.Map<java.lang.String,?> env, JmsJmxConnectionFactory factory) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
connect
public void connect() throws java.io.IOException
Establishes the connection to the connector server.- Specified by:
connect
in interfacejavax.management.remote.JMXConnector
- Throws:
java.io.IOException
-
connect
public void connect(java.util.Map env) throws java.io.IOException
Establishes the connection to the connector server.- Specified by:
connect
in interfacejavax.management.remote.JMXConnector
- Parameters:
env
- the properties of the connection. It will be ignored.- Throws:
java.io.IOException
-
getMBeanServerConnection
public javax.management.MBeanServerConnection getMBeanServerConnection()
- Specified by:
getMBeanServerConnection
in interfacejavax.management.remote.JMXConnector
-
getMBeanServerConnection
public javax.management.MBeanServerConnection getMBeanServerConnection(javax.security.auth.Subject delegationSubject)
Note that this is unsupported and will throw anUnsupportedOperationException
.- Specified by:
getMBeanServerConnection
in interfacejavax.management.remote.JMXConnector
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in interfacejavax.management.remote.JMXConnector
- Throws:
java.io.IOException
-
addConnectionNotificationListener
public void addConnectionNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback)
- Specified by:
addConnectionNotificationListener
in interfacejavax.management.remote.JMXConnector
-
removeConnectionNotificationListener
public void removeConnectionNotificationListener(javax.management.NotificationListener listener) throws javax.management.ListenerNotFoundException
- Specified by:
removeConnectionNotificationListener
in interfacejavax.management.remote.JMXConnector
- Throws:
javax.management.ListenerNotFoundException
-
removeConnectionNotificationListener
public void removeConnectionNotificationListener(javax.management.NotificationListener l, javax.management.NotificationFilter f, java.lang.Object handback) throws javax.management.ListenerNotFoundException
- Specified by:
removeConnectionNotificationListener
in interfacejavax.management.remote.JMXConnector
- Throws:
javax.management.ListenerNotFoundException
-
getConnectionId
public java.lang.String getConnectionId()
- Specified by:
getConnectionId
in interfacejavax.management.remote.JMXConnector
-
-