Management of EHCache - 6.3

Talend ESB Mediation Developer Guide

EnrichVersion
6.3
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend ESB

EHCache has its own statistics and management from JMX.

Here's a snippet on how to expose them via JMX in a Spring application context:

<bean id="ehCacheManagementService" 
   class="net.sf.ehcache.management.ManagementService" 
   init-method="init" lazy-init="false">
   <constructor-arg>
      <bean class="net.sf.ehcache.CacheManager" 
         factory-method="getInstance"/>
   </constructor-arg>
   <constructor-arg>
      <bean class="org.springframework.jmx.support.JmxUtils" 
         factory-method="locateMBeanServer"/>
   </constructor-arg>
   <constructor-arg value="true"/>
   <constructor-arg value="true"/>
   <constructor-arg value="true"/>
   <constructor-arg value="true"/>
</bean>

Of course the same thing can be done in straight Java:

ManagementService.registerMBeans(CacheManager.getInstance(), 
   mbeanServer, true, true, true, true);

You can get cache hits, misses, in-memory hits, disk hits, size stats this way. You can also change CacheConfiguration parameters on the fly.