org.rhq.plugins.jbossas5.helper
Class JmxConnectionHelper

java.lang.Object
  extended by org.rhq.plugins.jbossas5.helper.JmxConnectionHelper

public class JmxConnectionHelper
extends java.lang.Object

Shared helper class to connect to a remote server

Author:
Heiko W. Rupp

Field Summary
static java.lang.String CONNECTOR_ADDRESS
           
static java.lang.String CONNECTOR_CREDENTIALS
           
static java.lang.String CONNECTOR_DESCRIPTOR_TYPE
           
static java.lang.String CONNECTOR_PRINCIPAL
           
static java.lang.String JBOSS_HOME_DIR
           
 
Constructor Summary
JmxConnectionHelper(boolean copyConnectionLibraries, java.io.File tmpDir)
          Constructs a new connection helper.
 
Method Summary
 void closeConnection()
          If necessary attempt to close the EMS connection, then set this.connection null.
 org.mc4j.ems.connection.EmsConnection getEmsConnection()
          Obtain an EmsConnection.
 org.mc4j.ems.connection.EmsConnection getEmsConnection(Configuration config)
          Obtain an EmsConnection for the passed connection properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONNECTOR_DESCRIPTOR_TYPE

public static final java.lang.String CONNECTOR_DESCRIPTOR_TYPE
See Also:
Constant Field Values

CONNECTOR_ADDRESS

public static final java.lang.String CONNECTOR_ADDRESS
See Also:
Constant Field Values

CONNECTOR_PRINCIPAL

public static final java.lang.String CONNECTOR_PRINCIPAL
See Also:
Constant Field Values

CONNECTOR_CREDENTIALS

public static final java.lang.String CONNECTOR_CREDENTIALS
See Also:
Constant Field Values

JBOSS_HOME_DIR

public static final java.lang.String JBOSS_HOME_DIR
See Also:
Constant Field Values
Constructor Detail

JmxConnectionHelper

public JmxConnectionHelper(boolean copyConnectionLibraries,
                           java.io.File tmpDir)
Constructs a new connection helper.

Parameters:
copyConnectionLibraries - whether to copy the libraries need for the connection so that the ems classloader doesn't block the application access to them.
tmpDir - the temporary directory to use when copying the libraries
Method Detail

getEmsConnection

public org.mc4j.ems.connection.EmsConnection getEmsConnection(Configuration config)
Obtain an EmsConnection for the passed connection properties. The properties will be retained. To create a connection with different properties, use this method again with a different set of properties.

Parameters:
config - Configuration properties for this connection
Returns:
an EmsConnection or null in case of failure
See Also:
getEmsConnection()

getEmsConnection

public org.mc4j.ems.connection.EmsConnection getEmsConnection()
Obtain an EmsConnection. This will only work if the connection properties have passed before via a call to getEmsConnection(Configuration)

Returns:
an EmsConnection or null in case of failure
See Also:
getEmsConnection(org.rhq.core.domain.configuration.Configuration)

closeConnection

public void closeConnection()
If necessary attempt to close the EMS connection, then set this.connection null. Synchronized ensure we play well with loadConnection.



Copyright © 2008-2009 Red Hat, Inc.. All Rights Reserved.