Is it possible, ideally using the spring JMX annotations, to export a map of key value pairs where the key is used as the exported attribute name?
If so, how?
Thx.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The interface that Spring uses to build JMX metadata for a given bean is
MBeanInfoAssembler. This is a very general inerface, allowing any possibility that JMX itself will support, including exposing an arbitrary map as a set of JMX attributes.However, implementing that interface is quite a chore – the JMX API is a bit of a pig. Spring provides a number of implementations of various complexity, but they’re all geared around exposing javabean-style Spring beans. Even the more generic of the implementations,
AbstractMBeanInfoAssembler, assumes getters and setters to get the JMX attribute values.So you could write your own implementation of
MBeanInfoAssembler, but it’s going to be difficult.