[Design of JBossCache] - Re: JBCACHE-1025: JBossCache mbean registration fails on Web
by bstansberry@jboss.com
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
18 years, 11 months
[Design of JBossCache] - Re: JBCACHE-1025: JBossCache mbean registration fails on Web
by JerryGauth
I don't think that will help. First, I think that cache.getServiceName() will return null if my cache instance isn't defined as a jboss service.
Maybe I can set the service name after registration for later use but the problem remains that each interceptor's registration name is modified by WebSphere such that I can't easily derive it from a service name.
For example,
jboss.cache:service=TreeCache-Cluster,treecache-interceptor=TxInterceptor,
the registration name in WebSphere becomes jboss.cache:service=TreeCache-Cluster,cell=citgoNode01Cell,treecache-interceptor=TxInterceptor,node=citgoNode01,process=server1
I suppose I could parse the bits that WebSphere adds, figure out which should be used as a prefix, which as a postfix, etc. but that seems cumbersome and probably susceptible to other implementation quirks. It seems like it would be safer to just store the actual object names and use them when needed.
This could probably be optimized by determining whether we need to do this (e.g., only when an mbean server mangles names) but this code only executes when the cache is started or destroyed so it might not be worthwhile to optimize it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4038547#4038547
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4038547
18 years, 11 months