JConsole Example
This example shows how to register CacheStatistics in the JDK platform MBeanServer, which works with the JConsole management agent.
CacheManager manager = new CacheManager();
MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
ManagementService.registerMBeans(manager, mBeanServer, false, false, false,
true);
CacheStatistics MBeans are then registered. The following shows CacheStatistics MBeans in JConsole.