Difference between MBean and MXBean

Denim Datta picture Denim Datta · Apr 29, 2013 · Viewed 16.2k times · Source

I have the following questions regarding MBean and MXBean:

  1. What is the difference between MBean and MXBean?
  2. What are the use cases for MBean and MXBean?

Answer

Heiko Rupp picture Heiko Rupp · Apr 29, 2013

MXBeans are just a special kind of MBeans. The main difference is that MXBean restrict the data types, so that they are "more compatible" with potential clients.

As example: a MBean can expose attributes of a data type Foo. Now the client also needs to have this type Foo to make sense of the attribute.

The MXBean tries to restrict the data types to those "already available" - java.lang.* etc.

See this tutorial