[jboss-dev-forums] [Design of JBossCache] - Re: JBCACHE-1025: JBossCache mbean registration fails on Web

bstansberry@jboss.com do-not-reply at jboss.com
Wed Apr 18 13:47:08 EDT 2007


If you call server.registerMBean(cache, tmpObj) and then a subsequent call to cache.getServiceName() returns null, then WAS's JMX impl is broken. The JMX server should invoke the preRegister() callback before it returns from server.registerMBean(). If it doesn't, it's broken. If it does invoke preRegister(), it should register the mbean under whatever name preRegister returns (which in the TreeCache case will be the name that's passed in as an arg to preRegister).  If it registers it under some different name than what's returned by preRegister(), that's broken.

Another approach to the same thing while not counting on the preRegister() callback is to do this:

ObjectInstance oi = server.registerMBean(cache, tmpObj);
tmpName = oi.getObjectName().getCanonicalName().

Per the MBeanServer.registerMBean javadoc, the return value for that call is "An ObjectInstance, containing the ObjectName and the Java class name of the newly registered MBean.". If the WAS JMX doesn't even respect that, it's super broken.



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4038556#4038556

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4038556



More information about the jboss-dev-forums mailing list