DP requires a statically compiled interface. If you add/remove attributes to a dynamic mbean you would need to create a new dynamic proxy with a new static interface.
However, the MBeanProxy in JMX package also implements the DynamicMbean interface. This means that you can type cast the same proxy to either Standard or dynamic interface.
So if you add a new attribute to the mbean at run-time, you should be able to do something like this:
ServiceMBean mbean = MBeanProxy.create(ServiceMBean.class);
// new attribute being added...
DynamicMBean dmbean = (DynamicMBean)mbean;
dmbean.setAttribute(new Attribute("MyNewAttribute", "SomeValue"));
So you can always fall back to the non-typed dynamic invocation.
Should we add DynamicMBean support to the
MBeanServerInvocationHandler in jmx1.2/jboss4?
It's not part of the spec, but it is obviously useful.
sure why not, it won't affect the public object interfaces
I was actually looking at the MBeanProxy from the
I see the DymanicMBean support in jboss-head in the
This is what I was looking for.