Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Monitoring ehcache using JMX and JConsole

ehcache Management and Statistics are enabled in the jmxContext.xml Spring configuration file:

Code Block
xml
xml

<!-- Ref to the mbean server -->
<bean id="mbeanServer" class="org.springframework.jmx.support.MBeanServerFactoryBean">
    <property name="locateExistingServerIfPossible" value="true" />
</bean>
	.
	.

...


	.
<!-- EhCache management and statistics -->
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
    <property name="targetClass" value="net.sf.ehcache.management.ManagementService" />
    <property name="targetMethod" value="registerMBeans" />
    <property name="arguments">
        <list>
            <ref bean="cacheManager" />
            <ref bean="mbeanServer" />
            <value>true</value>
            <value>true</value>
            <value>true</value>
            <value>true</value>
        </list>
    </property>
</bean>

...