I'm a bit concerned that there's no longer any way to inject an MBeanServer into a
PojoCache/Cache/TreeCache. In 1.x, the server was injected via the
ServiceMBeanSupport's impl of javax.management.MBeanRegistration. In HEAD, that's
gone with no replacement. We now rely solely on the internal MBeanServer lookup code in
JmxUtil.
That lookup code works fine in the AS, since JmxUtil prefers to find the "jboss"
MBeanServer. Also works outside the AS if there is only one MBeanServer in the JVM.
It's not reliable outside the AS if there is more than one MBeanServer in the JVM.
This could be a real problem, because the way JBC now does JMX integration provides no
hooks to allow a user to manage the integration themselves -- at least not if they use our
factories. E.g. this won't work:
MBeanServer weblogicServer = getWebLogicJMXFromSomewhere();
| Configuration config = buildConfigSomehow();
| Cache cache = DefaultCacheFactory.createCache(config, false);
| weblogicServer.registerMBean(cache, new ObjectName(...)); // FAIL! Cache is not an
mbean
At first I thought we could add get/setMBeanServer() to CacheSPI. But that doesn't
work for PojoCache, which doesn't extend CacheSPI. Adding get/setMBeanServer() to
PojoCache sounds terrible.
Another option is to add overloaded methods to CacheFactory and PojoCacheFactory, where
the MBeanServer is passed to createCache. The factory can then pass the server into
TreeCache and PojoCacheImpl.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3983266#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...