Class HostForwarding<T>

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

    public class HostForwarding<T>
    extends 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 Detail

      • log

        public static final org.slf4j.Logger log
        The log.
    • Method Detail

      • getInstance

        public static <T> HostForwarding getInstance​(Class<T> asInterface,
                                                     MBeanServer mBeanServer,
                                                     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 Map<String,​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 MBeanServer getMBeanServer()
        Get the mbean server that proxies to remote mbeans are registered in.
        Returns:
        The mbean server with proxy mbeans.