+public class CdmServiceCacher extends CdmCacher {
+
+ @Autowired
+ ITermService termService;
+
+ @Autowired
+ private CdmEntitySessionManager cdmEntitySessionManager;
+
+ private CdmTransientEntityCacher cdmTransientEntityCacher;
+
+ private CacheLoader cacheLoader;
+
+ @Override
+ protected void setup() {
+ DefinedTermBase.setCacher(this);
+ CdmTransientEntityCacher.setDefaultCacher(this);
+ TermServiceRequestExecutor.setDefaultCacher(this);
+ cacheLoader = new CacheLoader(this);
+ }
+
+ @Override
+ protected CacheConfiguration getDefaultCacheConfiguration() {
+ // For a better understanding on how to size caches, refer to
+ // http://ehcache.org/documentation/configuration/cache-size
+
+ SizeOfPolicyConfiguration sizeOfConfig = new SizeOfPolicyConfiguration();
+ sizeOfConfig.setMaxDepth(100);
+ sizeOfConfig.setMaxDepthExceededBehavior("abort");
+
+ return new CacheConfiguration(DEFAULT_CACHE_NAME, 0)
+ .eternal(true)
+ .statistics(true)
+ .sizeOfPolicy(sizeOfConfig)
+ .overflowToOffHeap(false);
+
+ }