exposed EHCache 1.7's "statisticsEnabled"/"sampledStatisticsEnabled" on EhCacheFactoryBean ()
This commit is contained in:
parent
61a5ab9d34
commit
a09a0316b7
|
|
@ -99,6 +99,10 @@ public class EhCacheFactoryBean implements FactoryBean<Ehcache>, BeanNameAware,
|
||||||
|
|
||||||
private Set<CacheEventListener> cacheEventListeners;
|
private Set<CacheEventListener> cacheEventListeners;
|
||||||
|
|
||||||
|
private boolean statisticsEnabled = false;
|
||||||
|
|
||||||
|
private boolean sampledStatisticsEnabled = false;
|
||||||
|
|
||||||
private boolean disabled = false;
|
private boolean disabled = false;
|
||||||
|
|
||||||
private String beanName;
|
private String beanName;
|
||||||
|
|
@ -268,6 +272,22 @@ public class EhCacheFactoryBean implements FactoryBean<Ehcache>, BeanNameAware,
|
||||||
this.cacheEventListeners = cacheEventListeners;
|
this.cacheEventListeners = cacheEventListeners;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set whether to enable EhCache statistics on this cache.
|
||||||
|
* @see net.sf.ehcache.Cache#setStatisticsEnabled
|
||||||
|
*/
|
||||||
|
public void setStatisticsEnabled(boolean statisticsEnabled) {
|
||||||
|
this.statisticsEnabled = statisticsEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set whether to enable EhCache's sampled statistics on this cache.
|
||||||
|
* @see net.sf.ehcache.Cache#setSampledStatisticsEnabled
|
||||||
|
*/
|
||||||
|
public void setSampledStatisticsEnabled(boolean sampledStatisticsEnabled) {
|
||||||
|
this.sampledStatisticsEnabled = sampledStatisticsEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set whether this cache should be marked as disabled.
|
* Set whether this cache should be marked as disabled.
|
||||||
* @see net.sf.ehcache.Cache#setDisabled
|
* @see net.sf.ehcache.Cache#setDisabled
|
||||||
|
|
@ -341,6 +361,12 @@ public class EhCacheFactoryBean implements FactoryBean<Ehcache>, BeanNameAware,
|
||||||
cache.getCacheEventNotificationService().registerListener(listener);
|
cache.getCacheEventNotificationService().registerListener(listener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.statisticsEnabled) {
|
||||||
|
cache.setStatisticsEnabled(true);
|
||||||
|
}
|
||||||
|
if (this.sampledStatisticsEnabled) {
|
||||||
|
cache.setSampledStatisticsEnabled(true);
|
||||||
|
}
|
||||||
if (this.disabled) {
|
if (this.disabled) {
|
||||||
cache.setDisabled(true);
|
cache.setDisabled(true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue