OpendsJmxConnector.java revision 61170eb896ac0b7d9ac91c276699d1f1c3c8d8c9
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2006-2008 Sun Microsystems, Inc.
* Portions Copyright 2015 ForgeRock AS
*/
/**
* 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.
* <p>
* Note that the javadoc has been copied from the
* javax.management.remote.JMXConnector interface.
*/
public class OpendsJmxConnector implements JMXConnector
{
/** The wrapped JMX RMI connector. */
private JMXConnector jmxc;
/** The connection environment set at creation. */
/** The JMX Service URL. */
private JMXServiceURL serviceURL;
/**
* 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.
*
* @param serverHostname the target server hostname
*
* @param serverPort the target server port
*
* @param environment 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 of
* <code>environment</code> are not changed by this call.
*
* @exception IOException if the connector client cannot be made
* because of a communication problem.
*/
{
serviceURL = new JMXServiceURL(
+ "/org.opends.server.protocols.jmx.client-unknown");
this.environment = environment ;
}
/**
* Returns the connection environment.
*
* @return Map the connection environment used by new connections
*/
{
return environment;
}
/** {@inheritDoc} */
{
}
/** {@inheritDoc} */
{
}
/** {@inheritDoc} */
{
return jmxc.getMBeanServerConnection();
}
/** {@inheritDoc} */
{
}
/** {@inheritDoc} */
public void close() throws IOException
{
}
/** {@inheritDoc} */
public void addConnectionNotificationListener(
{
}
/** {@inheritDoc} */
public void removeConnectionNotificationListener(
{
}
/** {@inheritDoc} */
public void removeConnectionNotificationListener(
throws ListenerNotFoundException
{
}
/** {@inheritDoc} */
{
return jmxc.getConnectionId();
}
}