dk.netarkivet.monitor.jmx
Class HostForwarding<T>

java.lang.Object
  extended by dk.netarkivet.monitor.jmx.HostForwarding<T>

public class HostForwarding<T>
extends java.lang.Object

Handles the forwarding of other hosts' MBeans matching a specific regular query and interface to a given mbean server. The interface should be of type T.


Field Summary
static java.lang.String JMX_MONITOR_ROLE_USERNAME
          The username used to connect to the MBeanservers.
static int JMX_RMI_INCREMENT
          The RMI port is presently set to the JMX-port + this increment.
static org.apache.commons.logging.Log log
           
 java.lang.String mBeanQuery
          The query to the MBeanserver to get the MBeans.
 
Method Summary
static
<T> HostForwarding
getInstance(java.lang.Class<T> asInterface, javax.management.MBeanServer mBeanServer, java.lang.String query)
          Get a host forwarding instance.
 javax.management.MBeanServer getMBeanServer()
          Get the mbean server that proxies to remote mbeans are registered in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.apache.commons.logging.Log log

JMX_MONITOR_ROLE_USERNAME

public static final java.lang.String JMX_MONITOR_ROLE_USERNAME
The username used to connect to the MBeanservers.

See Also:
Constant Field Values

JMX_RMI_INCREMENT

public static final int JMX_RMI_INCREMENT
The RMI port is presently set to the JMX-port + this increment.

See Also:
Constant Field Values

mBeanQuery

public final java.lang.String mBeanQuery
The query to the MBeanserver to get the MBeans.

Method Detail

getInstance

public static <T> HostForwarding getInstance(java.lang.Class<T> asInterface,
                                             javax.management.MBeanServer mBeanServer,
                                             java.lang.String query)
Get a host forwarding instance. As a side effect of this, all mbeans matching a query from remote hosts, are proxied and registered in the given mbean server. Only one HostForwarding instance will be made for each query string. Any subsequent call with the same query string will simply return the previously initiated instance.

Parameters:
asInterface - The interface remote mbeans should implement
mBeanServer - The MBean server to register proxy mbeans in.
query - The query for which we should proxy matching mbeans on remote servers.
Returns:
This host frwarding instance.

getMBeanServer

public javax.management.MBeanServer getMBeanServer()
Get the mbean server that proxies to remote mbeans are registered in.

Returns:
The mbean server with proxy mbeans.