Class HostForwarding<T>

  • Type Parameters:
    T - The type of object exposed through the MBeans.

    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

      Fields 
      Modifier and Type Field Description
      static org.slf4j.Logger log
      The log.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.slf4j.Logger log
        The log.
    • 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.