Daniel Fuchs daniel.fuchs at
Tue Feb 19 18:54:18 UTC 2019


JMX related issues are mostly discussed on the
serviceability-dev mailing list these days.

On 19/02/2019 09:31, netbeans at wrote:
> Dear Dev.
> 1) MXBeans
> I would like to recommend you simplify MXBeans as currently it is not so
> easy to use.
> E.g. If you need Map<String, Serializable> where even Serializable can be
> simple open types, so like dynamical for dirent key.

MXBeans are used to map model-specific interfaces to generic
openmbeans types. If your model consists of a map with dynamic
key value pairs - as opposed to an interface that has a number
of specific getters - then MXBeans may not be what you should

For instance, you can achieve what you describe by reverting to using
an OpenMBean directly, and expose your map as a CompositeData



> Additionally there is Date, but why it is not there new java.time objects.

JMX was added in Java 5. java.time in Java 8.

Extending the set of open types supported by MXBeans would offer
interesting challenges as to maintaining interoperability with
applications running on previous version of the JVM.
In other words: that might be hard.

> Or maybe MXBeans should be deprecated at all.

MXBeans work very well for their intended target usage.
They do have their limitations, but so have other types of
MBeans. It's a trade-off.

You can read about the different types of MBeans here:

> 2) Maps vs MBean
> As you my know there is use e.g. what ever type parameter you choose there
> is get(Object) and similar to other methods.
> So if you would like to use it as MBean Proxy you need to create new
> interface extending e.g. Map<String, String> (even target does it) and you
> have to explicitly create get(String).
> If you do not do it.

I am not sure I have understood all your concerns, but I believe
OpenMBeans and CompositeData is what might correspond to your needs.

best regards,

-- daniel

More information about the jdk-dev mailing list