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.
protected  org.ow2.util.log.Log logger
          Logger
 
Constructor Summary
JmxAP(CommandDispatcher cmdDispatcher)
          Creates a JmxAP that connects to the default URL.
JmxAP(java.lang.String jmxUrl, CommandDispatcher cmdDispatcher)
          Creates a JmxAP that connects to a URL.
 
Method Summary
 void closeMBeanServerConnection()
          In embedded mode only.
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()
          Get the JMX connection.
 javax.management.MBeanServerConnection getMBeanServerConnection(boolean usePool)
          Get the JMX connection.
 void releaseMBeanServerConnection()
          In embedded mode only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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

logger

protected org.ow2.util.log.Log logger
Logger

Constructor Detail

JmxAP

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

Parameters:
jmxUrl - URL to connect to.

JmxAP

public JmxAP(CommandDispatcher cmdDispatcher)
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()
Get the JMX connection. If MBeanCmd is embedded, the connection will be provide by a factory previously get. If MBeanCMd runs in standalone mode or if the factory is null, a non managed JMX connection will be set.

Returns:
The MBeanServerConnection instance used to connect to the J2EE server via JMX.

getMBeanServerConnection

public javax.management.MBeanServerConnection getMBeanServerConnection(boolean usePool)
Get the JMX connection. If MBeanCmd is embedded, the connection will be provide by a factory previously get. If MBeanCMd runs in standalone mode or if the factory is null, a non managed JMX connection will be set.

Returns:
The MBeanServerConnection instance used to connect to the J2EE server via JMX.

releaseMBeanServerConnection

public void releaseMBeanServerConnection()
In embedded mode only. Release the connection in the pool.


closeMBeanServerConnection

public void closeMBeanServerConnection()
In embedded mode only. Explicitly close the JMX connection in the pool, physically.


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.


Copyright © 2009 OW2 Consortium. All Rights Reserved.