[jboss-user] [JBoss Cache: Core Edition] - Which ObjectInstance to reference cache?
rax_m
do-not-reply at jboss.com
Tue Jul 21 06:02:51 EDT 2009
Hi,
I have managed to successfully start the JBoss Cache on a Glassfish server.
I am now trying to get a handle to the cache object so I can write/read from it or shut it down.
Unfortunately, when I look at the ObjectNames in the mbean server I find the following:
| [PPHCache]: jboss.cache:jmx-resource=CacheMgmtInterceptor,service=PPHCache
| [PPHCache]: jboss.cache:jmx-resource=MVCCLockManager,service=PPHCache
| [PPHCache]: jboss.cache:jmx-resource=RegionManager,service=PPHCache
| [PPHCache]: jboss.cache:jmx-resource=InterceptorChain,service=PPHCache
| [PPHCache]: jboss.cache:jmx-resource=TxInterceptor,service=PPHCache
| [PPHCache]: jboss.cache:jmx-resource=TransactionTable,service=PPHCache
| [PPHCache]: jboss.cache:jmx-resource=DataContainer,service=PPHCache
| [PPHCache]: jboss.cache:jmx-resource=RPCManager,service=PPHCache
|
I created the cache with the following Object Name: jboss.cache:service=PPHCache
So which ObjectName do I retrieve to access the cache object?
Thanks
Rax
NB. Below is the code I use to create the cache (I included only the "essential" steps):
| String serviceName="jboss.cache:service=PPHCache";
| Cache cache=null;
|
| CacheFactory factory = new DefaultCacheFactory();
| System.out.println("[PPHCache]: About to create cache");
| cache = factory.createCache();
|
| System.out.println("[PPHCache]: Get Platform MBeanServer");
|
| MBeanServer server = ManagementFactory.getPlatformMBeanServer();
| ObjectName on = null;
| System.out.println("[PPHCache]: Try to create ObjectName");
| on = new ObjectName(serviceName);
|
| JmxRegistrationManager jmxManager = new JmxRegistrationManager(cache, on);
| jmxManager.registerAllMBeans();
|
| System.out.println("[PPHCache] Start the cache.");
| cache.create();
| cache.start();
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4244914#4244914
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4244914
More information about the jboss-user
mailing list