-
1. Re: JMX interceptors without CacheJmxWrapper
k-dub Jul 11, 2007 4:19 PM (in response to k-dub)Oops, I forgot: This is 2.0.0 CR3 on Sun JDK 1.6.0_02 in a stand-alone app compiled to 1.5 target VM. We're trying to use Spring for configuration, rather than programmatic configuration.
-
2. Re: JMX interceptors without CacheJmxWrapper
brian.stansberry Jul 11, 2007 4:36 PM (in response to k-dub)You'd have to write your own class to handle the JMX registration. You can see what CacheJmxWrapper does; you basically need a CacheSPI (to get the interceptors), an MBeanServer, and some algorithm for creating the ObjectNames for the interceptors.
Is your concern that the CacheJmxWrapperMBean interface has too much? If you post an MBean interface you want, I can look into creating a limited super-interface that you could expose. No promises though.
Let me know how the Spring configuration goes. The JBC docs discuss using JBoss Microcontainer to build up a Configuration object, but I see no reason Spring wouldn't work just fine. I just haven't had time to do it to include in a doc. -
3. Re: JMX interceptors without CacheJmxWrapper
k-dub Jul 11, 2007 5:22 PM (in response to k-dub)"bstansberry@jboss.com" wrote:
Is your concern that the CacheJmxWrapperMBean interface has too much? If you post an MBean interface you want, I can look into creating a limited super-interface that you could expose. No promises though.
Our concern is that people could change the cache configuration and/or running behavior in undesirable ways. A desired interface would be completely read-only with no methods and no setters.
I'll look into the CacheSPI and see what is involved there, thanks for the tip. -
4. Re: JMX interceptors without CacheJmxWrapper
k-dub Jul 17, 2007 12:39 PM (in response to k-dub)So, I tried writing a ReadOnlyCacheJmxWrapperMBean with just getters, along with a ReadOnlyCacheJmxWrapper class which subclassed CacheJmxWrapper. I was very surprised to see JMX use the CacheJmxWrapperMBean interface rather than my ReadOnlyCacheJmxWrapperMBean.
So I basically had to write out all the functionality in ReadOnlyCacheJmxWrapper rather than subclassing CacheJmxWrapper, then everything worked.
By the way, I didn't get the Spring config working. I couldn't get any interceptors to show up in JConsole. I went with the programmatic MBean registration. -
5. Re: JMX interceptors without CacheJmxWrapper
brian.stansberry Jul 17, 2007 7:17 PM (in response to k-dub)"k-dub" wrote:
So, I tried writing a ReadOnlyCacheJmxWrapperMBean with just getters, along with a ReadOnlyCacheJmxWrapper class which subclassed CacheJmxWrapper. I was very surprised to see JMX use the CacheJmxWrapperMBean interface rather than my ReadOnlyCacheJmxWrapperMBean.
That seems strange. How did you register the bean in JMX. -
6. Re: JMX interceptors without CacheJmxWrapper
k-dub Jul 18, 2007 10:56 AM (in response to k-dub)Umm, yeah. Ignore my last post, I'm an idiot. :)
I forgotimplements ReadOnlyCacheJmxWrapperMBean
in my subclass, so naturally JMX exposed the CacheJmxWrapperMBean instead. Duh!