Show Table of Contents
MBeanrepresents a manageable resource such as a service, component, device or an application.
Red Hat JBoss Data Grid provides
MBeansthat monitor and manage multiple aspects. For example,
MBeansthat provide statistics on the transport layer are provided. If a JBoss Data Grid server is configured with JMX statistics, an
MBeanthat provides information such as the hostname, port, bytes read, bytes written and the number of worker threads exists at the following location:
MBeansare available under two JMX domains:
- jboss.as - these
MBeansare created by the server subsystem.
- jboss.infinispan - these
MBeansare symmetric to those created by embedded mode.
MBeansunder jboss.infinispan should be used for Red Hat JBoss Data Grid, as the ones under jboss.as are for Red Hat JBoss Enterprise Application Platform.
A full list of available MBeans, their supported operations and attributes, is available in the Appendix
21.8.1. Understanding MBeans
When JMX reporting is enabled at either the Cache Manager or Cache level, use a standard JMX GUI such as JConsole or VisualVM to connect to a Java Virtual Machine running Red Hat JBoss Data Grid. When connected, the following
- If Cache Manager-level JMX statistics are enabled, an
jboss.infinispan:type=CacheManager,name="DefaultCacheManager"exists, with properties specified by the Cache Manager
- If the cache-level JMX statistics are enabled, multiple
MBeansdisplay depending on the configuration in use. For example, if a write behind cache store is configured, an
MBeanthat exposes properties that belong to the cache store component is displayed. All cache-level
MBeansuse the same format:
jboss.infinispan:type=Cache,name="<name-of-cache>(<cache-mode>)",manager="<name-of-cache-manager>",component=<component-name>In this format:
- Specify the default name for the cache using the
cache-modeis replaced by the cache mode of the cache. The lower case version of the possible enumeration values represents the cache mode.
component-nameis replaced by one of the JMX component names from the JMX reference documentation.
As an example, the cache store JMX component
MBeanfor a default cache configured for synchronous distribution would be named as follows:
Each cache and cache manager name is within quotation marks to prevent the use of unsupported characters in these user-defined names.
21.8.2. Registering MBeans in Non-Default MBean Servers
The default location where all the MBeans used are registered is the standard JVM MBeanServer platform. Users can set up an alternative MBeanServer instance as well. Implement the MBeanServerLookup interface to ensure that the
getMBeanServer()method returns the desired (non default) MBeanServer.
To set up a non default location to register your MBeans, create the implementation and then configure Red Hat JBoss Data Grid with the fully qualified name of the class. An example is as follows:
To Add the Fully Qualified Domain Name Declaratively
Add the following snippet:
<globalJmxStatistics enabled="true" mBeanServerLookup="com.acme.MyMBeanServerLookup"/>
To Add the Fully Qualified Domain Name Programmatically
Add the following code:
GlobalConfiguration globalConfiguration = new GlobalConfigurationBuilder().globalJmxStatistics().enable(). mBeanServerLookup("com.acme.MyMBeanServerLookup").build();