Work with JMX MBeans on the Liberty profile
We can access the attributes and call the operations of Java Management Extensions (JMX) management beans (MBeans) on the Liberty profile. In addition, we can register our own MBeans from an application running on the Liberty profile.
The primary interfaces for interacting with MBeans on the Liberty profile :
- javax.management.MBeanServer, which is for application code running on the Liberty profile.
- javax.management.MBeanServerConnection, which is for external code running in a separate Java virtual machine.
We can use an instance of either of these interfaces to access the attributes and call the operations of MBeans.
To access MBeans run...
/\java/bin/jconsole.sh
Then click on the MBeans tab.
For application code running on the Liberty profile, we can use a javax.management.MBeanServer instance using the following code:
import java.lang.management.ManagementFactory; import javax.management.MBeanServer; ... MBeanServer mbs = ManagementFactory.getPlatformMBeanServer(); ...For external code running in a separate Java virtual machine, we can use a javax.management.MBeanServerConnection instance. See Develop a JMX Java client .
Subtopics
- List of provided MBeans
Liberty profile provides a list of MBeans and corresponding management interfaces we can leverage to manipulate and monitor the server.
- Examples of accessing MBean attributes and operations
We can use the Liberty profile to access the attributes, and call the operations, of Java Management Extensions (JMX) management beans (MBeans).
- Examples of registering MBeans
An application can register its own MBean instances on the Liberty profile. That MBean instance can then be used by other applications or external administrators.
- Example of setting up a JMX routing environment
We can use the Liberty profile to call Java Management Extensions (JMX) management beans (MBeans) on a collective member server through a collective controller server.
Parent topic: Access local and JMX REST connectors