-
1. Re: MBeanProxy design question
juhalindfors Jan 24, 2003 12:29 PM (in response to t1ckt0ck)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);
mbean.setFoo("foo");
mbean.setBar("bar");
// 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. -
2. Re: MBeanProxy design question
adrian.brock Jan 24, 2003 2:06 PM (in response to t1ckt0ck)Juha,
Should we add DynamicMBean support to the
MBeanServerInvocationHandler in jmx1.2/jboss4?
It's not part of the spec, but it is obviously useful.
Regards,
Adrian -
3. Re: MBeanProxy design question
juhalindfors Jan 25, 2003 4:41 AM (in response to t1ckt0ck)sure why not, it won't affect the public object interfaces
-
4. Re: MBeanProxy design question
t1ckt0ck Jan 27, 2003 10:09 AM (in response to t1ckt0ck)Juha-
I was actually looking at the MBeanProxy from the
jboss-3.0 tree.
I see the DymanicMBean support in jboss-head in the
mx/util/JMXInvocationHandler
This is what I was looking for.
Thanks
Scott C