Working with JMX MBeans on Liberty

We can access the attributes and call the operations of Java Management Extensions (JMX) management beans (MBeans) on Liberty. In addition, we can register our own MBeans from an application running on Liberty. The primary interfaces for interacting with MBeans on Liberty are as follows:

  • javax.management.MBeanServer, which is for application code running on Liberty.
  • javax.management.MBeanServerConnection, which is for external code running in a separate Java virtual machine.

For sample Liberty admin scripts, see:

We can use an instance of either of these interfaces to access the attributes and call the operations of MBeans.

  • For application code running on Liberty, to use a javax.management.MBeanServer instance...

      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. For more information, see Develop a JMX Java client for Liberty.

  • To access JMX REST APIs available through the REST Connector features, see Configure secure JMX connection to Liberty. The REST APIs are used to manage MBean instances, invoke MBean operations, and query and modify MBean attributes.


Parent topic: Connecting to Liberty using JMX