Class MBeanRegistry


  • public class MBeanRegistry
    extends java.lang.Object
    This class provides a unified interface for registering/unregistering of zookeeper MBeans with the platform MBean server. It builds a hierarchy of MBeans where each MBean represented by a filesystem-like path. Eventually, this hierarchy will be stored in the zookeeper data tree instance as a virtual data tree.
    • Constructor Detail

      • MBeanRegistry

        public MBeanRegistry()
    • Method Detail

      • setInstance

        public static void setInstance​(MBeanRegistry instance)
      • getPlatformMBeanServer

        public javax.management.MBeanServer getPlatformMBeanServer()
        Return the underlying MBeanServer that is being used to register MBean's. The returned MBeanServer may be a new empty MBeanServer if running through IKVM.
      • register

        public void register​(ZKMBeanInfo bean,
                             ZKMBeanInfo parent)
                      throws javax.management.JMException
        Registers a new MBean with the platform MBean server.
        Parameters:
        bean - the bean being registered
        parent - if not null, the new bean will be registered as a child node of this parent.
        Throws:
        javax.management.JMException
      • unregister

        public void unregister​(ZKMBeanInfo bean)
        Unregister MBean.
        Parameters:
        bean -
      • unregisterAll

        public void unregisterAll()
        Unregister all currently registered MBeans
      • makeFullPath

        public java.lang.String makeFullPath​(java.lang.String prefix,
                                             java.lang.String... name)
        Generate a filesystem-like path.
        Parameters:
        prefix - path prefix
        name - path elements
        Returns:
        absolute path