Package org.infinispan.jmx
Class CacheJmxRegistration
java.lang.Object
org.infinispan.jmx.CacheJmxRegistration
- All Implemented Interfaces:
ObjectNameKeys
If
Configuration.statistics()
is enabled, then class will register all
the MBeans from cache local's ConfigurationRegistry to the MBean server.- Since:
- 4.0
- Author:
- Mircea.Markus@jboss.com, Galder ZamarreƱo
-
Field Summary
Fields inherited from interface org.infinispan.jmx.ObjectNameKeys
COMPONENT, MANAGER, NAME, TYPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
enabled()
Checks that JMX is effectively enabled.final String
Gets the domain name.final String
Gets the group name.final MBeanServer
Gets the MBean server.protected String
Subclasses must implement this hook to initializegroupName
during start.registerExternalMBean
(Object managedComponent, String groupName) Registers a MBean, but does not track it to perform automatic unregistration on stop.void
registerMBean
(Object managedComponent) Registers a MBean (and tracks it to perform automatic unregistration on stop).void
registerMBean
(Object managedComponent, String groupName) Registers a MBean (and tracks it to perform automatic unregistration on stop).void
start()
Looks up the MBean server and initializes domain and group.void
stop()
Unregisters the MBeans that were registered on start.void
unregisterMBean
(ObjectName objectName) Unregisters the MBean located under the givenObjectName
, if it exists.
-
Constructor Details
-
CacheJmxRegistration
public CacheJmxRegistration()
-
-
Method Details
-
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. -
initGroup
Subclasses must implement this hook to initializegroupName
during start. -
enabled
public final boolean enabled()Checks that JMX is effectively enabled. -
getDomain
Gets the domain name. This should not be called unless JMX is enabled. -
getGroupName
Gets the group name. This should not be called unless JMX is enabled. -
getMBeanServer
Gets the MBean server. This should not be called unless JMX is enabled. -
registerExternalMBean
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
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
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
Unregisters the MBean located under the givenObjectName
, if it exists.- Parameters:
objectName
-ObjectName
where the MBean is registered- Throws:
Exception
- If unregistration could not be completed.
-