jodd.util
Class JmxClient

java.lang.Object
  extended by jodd.util.JmxClient

public class JmxClient
extends Object

Simple JMX client.


Field Summary
protected  AtomicBoolean connected
           
protected  JMXConnector connector
           
protected  MBeanServerConnection mbsc
           
 
Constructor Summary
JmxClient(String serviceUrl)
           
JmxClient(String serviceUrl, String userName, String passwd)
           
 
Method Summary
protected  void assertConnected()
          Checks if we are connected to the jmx
protected  ObjectName buildObjectName(String mbeanName)
          Builds object name.
 void close()
          Closes JMX connector.
 Object getAttribute(String mbeanName, String attributeName)
          Returns bean attribute.
<T> T
getMBeanProxy(String mbeanName, Class<T> mBeanInterface)
          Creates MBean proxy.
 void invoke(String mbeanName, String methodName)
          Invokes bean method.
 void invoke(String mbeanName, String methodName, Object[] params, String[] signature)
          Invokes bean method.
 void setAttribute(String mbeanName, String attributeName, Object value)
          Defines bean attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connector

protected JMXConnector connector

mbsc

protected MBeanServerConnection mbsc

connected

protected AtomicBoolean connected
Constructor Detail

JmxClient

public JmxClient(String serviceUrl)
          throws IOException
Throws:
IOException

JmxClient

public JmxClient(String serviceUrl,
                 String userName,
                 String passwd)
          throws IOException
Throws:
IOException
Method Detail

close

public void close()
           throws IOException
Closes JMX connector.

Throws:
IOException

getMBeanProxy

public <T> T getMBeanProxy(String mbeanName,
                           Class<T> mBeanInterface)
Creates MBean proxy.


getAttribute

public Object getAttribute(String mbeanName,
                           String attributeName)
Returns bean attribute.


setAttribute

public void setAttribute(String mbeanName,
                         String attributeName,
                         Object value)
Defines bean attribute.


invoke

public void invoke(String mbeanName,
                   String methodName)
Invokes bean method.


invoke

public void invoke(String mbeanName,
                   String methodName,
                   Object[] params,
                   String[] signature)
Invokes bean method.


assertConnected

protected void assertConnected()
Checks if we are connected to the jmx


buildObjectName

protected ObjectName buildObjectName(String mbeanName)
Builds object name.