I am struggling to understand how to take advantage/use the MBeanInfo
(and related MBeanAttributeInfo
, ModelMBeanInfo
etc.) and related to it Descriptors
.
As far as I understand MBean*Info
is simply like a Class
object containing information on available methods/attributes/constructors etc. Also, as far as I see it, this information is immutable and generated for us in the process of MBeanServer.registerMBean
or using StandardMBean
class (maybe the MBeanServer actually uses the StandardMbean
class?) which uses reflection to generate this information. Is this more or less correct?
Also, I guess there exist a concept of a ModelMBean
, to which we are able to pass our own MBeanInfo
programmatically. What is the point of doing so if the same can be achieved via a StandardMbean
with reflection?
Finally, Descriptors
were put in place to allow users to extend information on the mbeans by providing (name,value) pairs in the form of descriptor. This can be attached to any of the MBean*Info
classes (constructor, attribute, operation etc.) However, it can be attached during the construction of the Info object, as it is immutable. Therefore, using StandardMbean
, that generates this info on its own, there is no way to inject extra information, as the descriptor we get from the MBeanInfo
is immutable too... Am I missing something here? What would be the easy way to add extra information to descriptors of contructors/fields/methods on a MBean
?