Configuring Custom MBeans

Skip to end of metadata
Go to start of metadata

This section describes the following steps for configuring custom MBeans.

Creating a Configuration File

Custom MBeans are configured in an XML configuration file. The elements in the file describe the MBean type, MBean implementation, and the target MBean ObjectName. The current release of Coherence supports these types of custom MBeans.

The MBean reference provides complete descriptions of the elements used in this section.

Configuring Standard MBeans

The following example will create a Coherence:type=Query,nodeId=<nodeId> using the standard MBean com.oracle.customMBeans.Query class for the node. This example specifies an MBean class (mbean-class), an MBean name (mbean-name), and whether it is registered (enabled) in the instance.

Configuring MXBeans

The following example will execute the standard Java method getMemoryMXBean in the java.lang.management.ManagementFactory class and use the result to create a Coherence:type=java,SubSystem=Memory,nodeId=<nodeId> for the node. the example specifies an MBean factory (mbean-factory), an accessor method name on the factory (mbean-accessor), an MBean name (mbean-name), and whether it is registered (enabled) in the instance.

Configuring JMX MBeans

JMX MBeans are MBeans that exist in a local MBean server that need to be added to the Coherence Management structure. This allows consolidation of MBeanServer information into a single source. The following example executes the JMX query, java.lang:*, on the node's local MBean server and uses the results to create corresponding MBeans on the centralized Coherence MBean server. The example specifies a JMX MBean query (mbean-query), an MBean name (mbean-name), and whether it is registered (enabled) in the instance.

Enabling a Custom MBean Configuration File

You can enable the custom MBean configuration file by setting a system property or by including a specially named file in the class path.

Setting a System Property

Coherence provides the following system property to specify the name and location of a custom MBean configuration file. Setting this system property will cause the Coherence node to load the MBeans defined in the file represented by filename.

Adding a Named File to the Class Path

By convention, Coherence recognizes the configuration file named custom-mbeans.xml as containing a custom MBean configuration. If you name your custom MBean configuration file custom-mbeans.xml and include it in the class path, then the Coherence node will load the configured MBeans.

Labels:
mbeans mbeans Delete
reporter reporter Delete
jmx jmx Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.