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

java.lang.Object
  extended by dk.netarkivet.monitor.jmx.HostForwarding<T>
Type Parameters:
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 org.apache.commons.logging.Log log
          The log.
 java.lang.String mBeanQuery
          The query to the MBeanserver to get the MBeans.
 
Method Summary
static java.util.Map<java.lang.String,java.util.Set<HostEntry>> getCurrentHostEntries()
          Get current list of host-JMX port mappings.
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
The log.


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.

Type Parameters:
T - The type of HostForwarding to return.
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 forwarding instance.

getCurrentHostEntries

public static java.util.Map<java.lang.String,java.util.Set<HostEntry>> getCurrentHostEntries()
Get current list of host-JMX port mappings. This lists the mappings from the registry server.

Returns:
current list of host-JMX port mappings.

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.