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#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...