[Prev] Thread [Next]  |  [Prev] Date [Next]

[jbosscache-dev] Accessing Cache instances from AS5 Galder Zamarreno Wed Jun 10 08:00:31 2009


Having looked at this forum post thread (http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4235313#4235313), I wanted to check, specially with Brian, what's the preferred method in AS5 to get access to a local cache.

First of all, anything bound to JNDI needs to be Serializable. http://www.jboss.org/community/wiki/JMXMBeanRemoteProxy wiki explains how to bind a proxy to an MBean into JNDI and retrieve it remotely. Don't think this is what the user wants though. It looks as if he only wants to access it from diff apps.

Traditionally, there was always the JMX method to retrieve a local Cache instance (see http://is.gd/WOmk) but this section has dissapeared from the latest JBC 3.1 documentation in http://is.gd/WOsH.

I know that CacheJmxWrapperMBean and CacheJmxWrapper have been deprecated and instead org.jboss.cache.jmx.JmxRegistrationManager is now in place but it's unclear from the code what's the alternative. One that I can think of is MC bean injection but that assumes your app is build around MC beans which could or not happen.

Finally, one thing to note to everyone, if you simply name your MC bean with -beans.xml, it won't deploy it!! Thanks to Emanuel who helped me figure out why a cache instance wouldn't deploy. Instead, it should be named -jboss-beans.xml. I'll create a JIRA to fix this.

Galder ZamarreƱo
Sr. Software Maintenance Engineer
JBoss, a division of Red Hat
jbosscache-dev mailing list