Package org.opends.server.protocols.jmx
Class OpendsJmxConnector
- java.lang.Object
-
- org.opends.server.protocols.jmx.OpendsJmxConnector
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,JMXConnector
public class OpendsJmxConnector extends Object implements JMXConnector
Wrapper class for the JMX's RMI connector. This class has the exact same functionalities but maintain inner variables which are used during the connection phase.Note that the javadoc has been copied from the javax.management.remote.JMXConnector interface.
-
-
Field Summary
-
Fields inherited from interface javax.management.remote.JMXConnector
CREDENTIALS
-
-
Constructor Summary
Constructors Constructor Description OpendsJmxConnector(String serverHostname, int serverPort, Map<String,Object> environment)
Creates a connector client for the connector server at the given host and port.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConnectionNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
void
close()
void
connect()
void
connect(Map<String,?> env)
Map<String,Object>
getConnectionEnv()
Returns the connection environment.String
getConnectionId()
MBeanServerConnection
getMBeanServerConnection()
MBeanServerConnection
getMBeanServerConnection(Subject delegationSubject)
void
removeConnectionNotificationListener(NotificationListener listener)
void
removeConnectionNotificationListener(NotificationListener l, NotificationFilter f, Object handback)
-
-
-
Constructor Detail
-
OpendsJmxConnector
public OpendsJmxConnector(String serverHostname, int serverPort, Map<String,Object> environment) throws IOException
Creates a connector client for the connector server at the given host and port. The resultant client is not connected until its connect method is called.- Parameters:
serverHostname
- the target server hostnameserverPort
- the target server portenvironment
- a set of attributes to determine how the connection is made. This parameter can be null. Keys in this map must be Strings. The appropriate type of each associated value depends on the attribute. The contents ofenvironment
are not changed by this call.- Throws:
IOException
- if the connector client cannot be made because of a communication problem.
-
-
Method Detail
-
getConnectionEnv
public Map<String,Object> getConnectionEnv()
Returns the connection environment.- Returns:
- Map the connection environment used by new connections
-
connect
public void connect() throws IOException
- Specified by:
connect
in interfaceJMXConnector
- Throws:
IOException
-
connect
public void connect(Map<String,?> env) throws IOException
- Specified by:
connect
in interfaceJMXConnector
- Throws:
IOException
-
getMBeanServerConnection
public MBeanServerConnection getMBeanServerConnection() throws IOException
- Specified by:
getMBeanServerConnection
in interfaceJMXConnector
- Throws:
IOException
-
getMBeanServerConnection
public MBeanServerConnection getMBeanServerConnection(Subject delegationSubject) throws IOException
- Specified by:
getMBeanServerConnection
in interfaceJMXConnector
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceJMXConnector
- Throws:
IOException
-
addConnectionNotificationListener
public void addConnectionNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
- Specified by:
addConnectionNotificationListener
in interfaceJMXConnector
-
removeConnectionNotificationListener
public void removeConnectionNotificationListener(NotificationListener listener) throws ListenerNotFoundException
- Specified by:
removeConnectionNotificationListener
in interfaceJMXConnector
- Throws:
ListenerNotFoundException
-
removeConnectionNotificationListener
public void removeConnectionNotificationListener(NotificationListener l, NotificationFilter f, Object handback) throws ListenerNotFoundException
- Specified by:
removeConnectionNotificationListener
in interfaceJMXConnector
- Throws:
ListenerNotFoundException
-
getConnectionId
public String getConnectionId() throws IOException
- Specified by:
getConnectionId
in interfaceJMXConnector
- Throws:
IOException
-
-