org.ow2.jasmine.monitoring.mbeancmd
Class JmxAP

java.lang.Object
  extended by org.ow2.jasmine.monitoring.mbeancmd.JmxAP

public class JmxAP
extends java.lang.Object

A JMX Access Point.


Field Summary
static java.lang.String DEFAULT_FILE
          Default name of the properties file.
static java.lang.String DEFAULT_URL
          Default JMX URL.
private static java.lang.String defaultTarget
          Default JMX target.
private  javax.management.MBeanServerConnection jmxConnection
          Current JMX jmxConnection.
private static java.util.Map jmxPasswords
          Map of JMX passwords.
private static java.util.Map jmxTargets
          Map of JMX targets.
private  java.lang.String jmxUrl
          Current JMX URL.
private static java.util.Map jmxUsers
          Map of JMX user names.
 
Constructor Summary
JmxAP()
          Creates a JmxAP that connects to the default URL.
JmxAP(java.lang.String jmxUrl)
          Creates a JmxAP that connects to a URL.
 
Method Summary
static java.lang.String getDefaultTarget()
           
static java.lang.String[] getJmxTargets()
           
static java.lang.String[] getJmxTargets(java.lang.String[] proposed)
          Gets the names of all JMX targets matching a certain criteria.
 java.lang.String getJmxUrl()
           
static java.lang.String getJmxUrl(java.lang.String name)
          Gets the JMX URL for a given server name.
 javax.management.MBeanServerConnection getMBeanServerConnection()
           
private static java.util.Properties getProperties(java.io.File propertyFile)
           
private static void load()
          Loads all JMX jmxConnection properties from a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

jmxConnection

private javax.management.MBeanServerConnection jmxConnection
Current JMX jmxConnection.


jmxUrl

private java.lang.String jmxUrl
Current JMX URL.


jmxTargets

private static java.util.Map jmxTargets
Map of JMX targets.


jmxUsers

private static java.util.Map jmxUsers
Map of JMX user names.


jmxPasswords

private static java.util.Map jmxPasswords
Map of JMX passwords.


defaultTarget

private static java.lang.String defaultTarget
Default JMX target.


DEFAULT_URL

public static final java.lang.String DEFAULT_URL
Default JMX URL.

See Also:
Constant Field Values

DEFAULT_FILE

public static final java.lang.String DEFAULT_FILE
Default name of the properties file.

See Also:
Constant Field Values
Constructor Detail

JmxAP

public JmxAP(java.lang.String jmxUrl)
Creates a JmxAP that connects to a URL.

Parameters:
jmxUrl - URL to connect to.

JmxAP

public JmxAP()
Creates a JmxAP that connects to the default URL.

Method Detail

getJmxUrl

public java.lang.String getJmxUrl()
Returns:
The String version of the JMX URL connected to.

getMBeanServerConnection

public javax.management.MBeanServerConnection getMBeanServerConnection()
Returns:
The MBeanServerConnection instance used to connect to the J2EE server via JMX.

getProperties

private static java.util.Properties getProperties(java.io.File propertyFile)
                                           throws java.io.IOException
Parameters:
propertyFile - File name of the properties file.
Returns:
Parsed version of the propertyFile file.
Throws:
java.io.IOException - If propertyFile cannot be read.

getJmxUrl

public static java.lang.String getJmxUrl(java.lang.String name)
Gets the JMX URL for a given server name.

Parameters:
name - Name of the server.
Returns:
JMX URL corresponding to that server name.

getJmxTargets

public static java.lang.String[] getJmxTargets()
Returns:
An array containing the names of all current JMX targets.

getJmxTargets

public static java.lang.String[] getJmxTargets(java.lang.String[] proposed)
Gets the names of all JMX targets matching a certain criteria.

Parameters:
proposed - Criteria.
Returns:
An array containing the names of all current JMX targets.

getDefaultTarget

public static java.lang.String getDefaultTarget()
Returns:
Default target.

load

private static void load()
Loads all JMX jmxConnection properties from a file.