org.pfsw.tools.cda.darc.client
Class BaseJMXClientConnection

java.lang.Object
  extended by org.pfsw.tools.cda.darc.client.BaseJMXClientConnection
Direct Known Subclasses:
DARCConnection

public class BaseJMXClientConnection
extends java.lang.Object

Provides a generic implementation of a JMX client connector.

Version:
1.0
Author:
M.Duchrow

Constructor Summary
BaseJMXClientConnection()
          Initialize the new instance with default values.
 
Method Summary
 void close()
          Close the JMX connection.
 javax.management.ObjectName getCurrentObjectName()
           
 java.lang.Object invoke(java.lang.String operationName, java.lang.Object[] params, java.lang.String[] signature)
          Executes the specified method on the currently selected MBean and returns its result object.
 boolean openConnection(java.lang.String hostAndPort)
          Open the remote connection to the given host and port ("host:port").
 boolean openConnection(java.lang.String host, int port)
          Open the remote connection to the given host and port.
 void selectMBean(java.lang.String lookupName)
          Select an MBean for communication by searching for it with the given lookup name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseJMXClientConnection

public BaseJMXClientConnection()
Initialize the new instance with default values.

Method Detail

getCurrentObjectName

public javax.management.ObjectName getCurrentObjectName()

close

public void close()
Close the JMX connection.


invoke

public java.lang.Object invoke(java.lang.String operationName,
                               java.lang.Object[] params,
                               java.lang.String[] signature)
                        throws java.lang.Exception
Executes the specified method on the currently selected MBean and returns its result object. Any exception will be caught and logged and then null is returned.

Throws:
java.lang.Exception

openConnection

public boolean openConnection(java.lang.String host,
                              int port)
Open the remote connection to the given host and port. Returns true if the connection has been established, otherwise false. Any exception will be logged.


openConnection

public boolean openConnection(java.lang.String hostAndPort)
Open the remote connection to the given host and port ("host:port"). Returns true if the connection has been established, otherwise false. Any exception will be logged.


selectMBean

public void selectMBean(java.lang.String lookupName)
Select an MBean for communication by searching for it with the given lookup name.