Skip Headers
Oracle® Coherence Developer's Guide
Release 3.5

Part Number E14509-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

28 How to Manage Custom MBeans Within the Cluster

In addition to managing Coherence with JMX, Coherence provides the ability to manage and monitor "custom MBeans" (that is, application-level MBeans) within the Coherence JMX Management and Monitoring framework. This enables you to manage or monitor any application-level MBean from any JVM, node, or end-point within the cluster.

In addition to the standard Coherence managed object types, any dynamic or standard MBean type may be registered using the com.tangosol.net.management.Registry interface.

Custom MBean Configuration

Coherence 3.4 can be configured to load platform and standard MBeans on connection to the cluster. This allows administrators and support personnel to update and view system and application information from all nodes in a cluster from a single location. This feature also eliminates the need for JMX programs to connect to multiple sources to gather information.

How to Add a Standard MBean to Coherence

The following instructions describe how to add a standard MBean to Coherence:

  1. Create a standard MBean.

  2. Add a standard MBean Class or JAR to the Coherence classpath (including central management node).

  3. Create a custom MBean XML configuration file (see "Creating an MBean XML Configuration File").

  4. Modify node startup scripts to reference custom-mbean.xml (see "Enabling a Custom MBean Configuration File".

How to Programatically Add a Standard MBean to Coherence

Example 28-1 illustrates sample code that programmatically adds a standard MBean to Coherence.

Example 28-1 Adding a Standard MBean to Coherence Programatically

Registry    registry = CacheFactory.ensureCluster().getManagement();
Custom      bean     = new Custom();
String      sName    = registry.ensureGlobalName("type=Custom");

registry.register(sName, bean);

How to Add a the Results of a JMX Query to Coherence

The following instructions describe how to add the results of a JMX query to Coherence.

  1. Create a custom MBean XML file (see "Creating an MBean XML Configuration File").

  2. Configure node startup script to include JMX MBean Server

  3. Configure a node startup script to reference custom-mbean.xml (see "Enabling a Custom MBean Configuration File").

Figure 28-1 illustrates an example of running a JMX Query in JConsole.

Figure 28-1 JMX Query Run in JConsole

Description of Figure 28-1 follows
Description of "Figure 28-1 JMX Query Run in JConsole"