Class CacheManagerJmxRegistration

java.lang.Object
org.infinispan.jmx.CacheManagerJmxRegistration
All Implemented Interfaces:
ObjectNameKeys

public final class CacheManagerJmxRegistration extends Object
Registers all the components from global component registry to the mbean server.
Since:
4.0
Author:
Mircea.Markus@jboss.com, Galder ZamarreƱo
  • Constructor Details

    • CacheManagerJmxRegistration

      public CacheManagerJmxRegistration()
  • Method Details

    • initGroup

      protected String initGroup()
      Subclasses must implement this hook to initialize groupName during start.
    • start

      public void start()
      Looks up the MBean server and initializes domain and group. Overriders must ensure they call super.
    • stop

      public void stop()
      Unregisters the MBeans that were registered on start. Overriders must ensure they call super.
    • enabled

      public final boolean enabled()
      Checks that JMX is effectively enabled.
    • getDomain

      public final String getDomain()
      Gets the domain name. This should not be called unless JMX is enabled.
    • getGroupName

      public final String getGroupName()
      Gets the group name. This should not be called unless JMX is enabled.
    • getMBeanServer

      public final MBeanServer getMBeanServer()
      Gets the MBean server. This should not be called unless JMX is enabled.
    • registerExternalMBean

      public ObjectName registerExternalMBean(Object managedComponent, String groupName) throws Exception
      Registers a MBean, but does not track it to perform automatic unregistration on stop. The caller is expected to perform unregistration using the returned ObjectName.
      Throws:
      Exception
    • registerMBean

      public void registerMBean(Object managedComponent) throws Exception
      Registers a MBean (and tracks it to perform automatic unregistration on stop). This method should be used for components that are registered after the startup of the component registry and did not get registered automatically.
      Throws:
      Exception
    • registerMBean

      public void registerMBean(Object managedComponent, String groupName) throws Exception
      Registers a MBean (and tracks it to perform automatic unregistration on stop). This method should be used only for components that are registered after the startup of the component registry and did not get registered automatically.
      Throws:
      Exception
    • unregisterMBean

      public void unregisterMBean(ObjectName objectName) throws Exception
      Unregisters the MBean located under the given ObjectName, if it exists.
      Parameters:
      objectName - ObjectName where the MBean is registered
      Throws:
      Exception - If unregistration could not be completed.