"bstansberry(a)jboss.com" wrote :
| Question: how does stuff get registered in JMX if deployed via a -beans.xml? I vaguely
recall reading somewhere months ago that that could be done, but I can't find anyplace
showing how. From what I see now (e.g. the AspectManager bean in the AS), it looks like
the bean needs to expose a property where the MC passes in the MBeanServer; presumably
it's then the bean's responsibility to register itself. Please let me know if
that's wrong.
Yes, that is wrong. The bean should not be doing anything except its core purpose. Beans
are not registered with jmx automatically. There has to be a configuration that expresses
this aspect, and the jmx aspect should be exposing the configured attributes/operations
from the pojo.
The org.jboss.test.microcontainer.test.JMXDecoratedTestCase illustrates the use of a JMX
annotation and associated org.jboss.aop.microcontainer.aspects.jmx.JMXIntroduction which
handles the registration of a simple bean like:
| package org.jboss.test.microcontainer.support;
|
| import org.jboss.aop.microcontainer.aspects.jmx.JMX;
|
| @JMX(name="test:name=AnnotatedBean",
exposedInterface=SimpleBeanImplMBean.class)
| public class SimpleBeanAnnotatedImpl extends SimpleBeanImpl
| {
| }
|
Let's get this fleshed out with Kabir's help.
In the interim if you run into issues, I would look at creating a CacheJmxWrapper that
exposes the mbean interface and delegates to the pojo cache to make sure jmx is fully
separated out of the core.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983308#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...