org.ow2.jasmine.monitoring.mbeancmd
Class JmxAp

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

public class JmxAp
extends Object

Jmx Access Point

Author:
francois Waeselynck

Constructor Summary
JmxAp(CommandDispatcher cmdDispatcher)
          Creates a JmxAp that connects to the default target's JMX URL.
JmxAp(String jmxUrl, CommandDispatcher cmdDispatcher)
          Creates a JmxAp that connects to a JMX URL.
 
Method Summary
 CommandDispatcher getCmdDispatcher()
           
 String getJmxUrl()
           
 MBeanServerConnection getMBeanServerConnection()
          Get the JMX connection.
 MBeanServerConnection getMBeanServerConnection(boolean usePool)
          Get the JMX connection.
 void releaseMBeanServerConnection()
          Release the connection in the pool, if pool is used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmxAp

public JmxAp(String jmxUrl,
             CommandDispatcher cmdDispatcher)
Creates a JmxAp that connects to a JMX URL.

Parameters:
jmxUrl - URL to connect to.
cmdDispatcher - CommandDispatcher instance corresponding to the current MBeanCmd command.

JmxAp

public JmxAp(CommandDispatcher cmdDispatcher)
Creates a JmxAp that connects to the default target's JMX URL.

Method Detail

getJmxUrl

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

getCmdDispatcher

public CommandDispatcher getCmdDispatcher()
Returns:
The commandDispatcher corresponding to the current MBeanCmd command.

getMBeanServerConnection

public MBeanServerConnection getMBeanServerConnection(boolean usePool)
Get the JMX connection. If MBeanCmd is embedded, the connection will be provided 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.

Parameters:
usePool - true if try to use the pool (most of the time)
Returns:
The MBeanServerConnection instance used to connect to the J2EE server via JMX.

getMBeanServerConnection

public 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.

releaseMBeanServerConnection

public void releaseMBeanServerConnection()
Release the connection in the pool, if pool is used.



Copyright © 2011 OW2 Consortium. All Rights Reserved.