[jboss-dev-forums] [Design of JBossCache] - Re: Can't control (Tree)Cache via JConsole
edgenuity
do-not-reply at jboss.com
Tue May 15 14:33:10 EDT 2007
Excerpt from my code below.
mBeanServer = ManagementFactory.getPlatformMBeanServer();
Configuration config = new Configuration();
config.setClusterName("CacheTest");
config.setExposeManagementStatistics(true);
config.setCacheMode(Configuration.CacheMode.LOCAL);
myCache = DefaultCacheFactory.getInstance().createCache(config);
myCache.addCacheListener(myCacheListener);
mBeanNameStr = JmxUtil.PREFIX +
myCache.getConfiguration().getClusterName();
JmxUtil.registerCacheMBean(
mBeanServer, new CacheJmxWrapper(myCache), mBeanNameStr);
ObjectName mBeanName = new ObjectName(mBeanNameStr);
if (mBeanServer.isRegistered(mBeanName))
System.out.println ("MBean Registered:"+mBeanNameStr);
else
System.out.println ("MBean not registered");
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4045908#4045908
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4045908
More information about the jboss-dev-forums
mailing list