[jboss-user] [JBossCache] - Re: 2.0 and JMX
bstansberry@jboss.com
do-not-reply at jboss.com
Fri Apr 20 13:24:20 EDT 2007
In JBC 2.0, the cache no longer self registers; you have to do it manually. Basically, we recognized that JMX integration is really not a core function of the cache, and 1) should be done by external code that understands the JMX environment, and 2) should be extracted into a separate class.
What you should do is:
| Cache cache = createCache();
| MBeanServer mbs = getMBeanServer();
| mbs.registerMBean(new org.jboss.cache.jmx.CacheJmxWrapper(cache), monitorName);
|
CacheJmxWrapper exposes a property "registerInterceptors", which defaults to true. When you register the wrapper in JMX, it gets a callback from JMX (via MBeanNotification interface) and if registerInterceptors=true it will register mbeans for all the interceptors.
I haven't looked at this for a while, and it may not work yet, but you can also try this semi-hacky trick:
| Cache cache = createCache();
| MBeanServer mbs = getMBeanServer();
| mbs.registerMBean(new org.jboss.cache.jmx.CacheLegacyJmxWrapper(cache), monitorName);
|
(note use of CacheLegacyJmxWrapper).
CacheLegacyJmxWrapper actually exposes via JMX getters for a lot of the configuration options.
I'll defer to Manik as to whether he wants to expose getMembers().
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039364#4039364
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039364
More information about the jboss-user
mailing list