How to manage the cache by JMX (using Spring & Tomcat)

View: New views
2 Messages — Rating Filter:   Alert me  

How to manage the cache by JMX (using Spring & Tomcat)

by Michael Smith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'd like to manage the cache via JMX. I've added this code:

CacheManager manager = new CacheManager();
    MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
    ManagementService.registerMBeans(manager, mBeanServer, false, false, false, true);

to my class that uses the cache, but I still don't see the cache in my JMX tree.  

Is there a way to do it without any programming, just via the Spring configuration?  If not, what code do I need to use?  

Thanks

Re: How to manage the cache by JMX (using Spring & Tomcat)

by Julien D :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Try this Monitoring ehcache with JMX and Spring.

Michael Smith wrote:
I'd like to manage the cache via JMX. I've added this code:

CacheManager manager = new CacheManager();
    MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
    ManagementService.registerMBeans(manager, mBeanServer, false, false, false, true);

to my class that uses the cache, but I still don't see the cache in my JMX tree.  

Is there a way to do it without any programming, just via the Spring configuration?  If not, what code do I need to use?  

Thanks