if (bus != null) {
b.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(this);
}
cacheManager = EHCacheUtils.getCacheManager(bus, configFileURL);
// Cannot overflow to disk as SecurityToken Elements can't be serialized
@SuppressWarnings("deprecation")
CacheConfiguration cc = EHCacheManagerHolder.getCacheConfiguration(key, cacheManager)
.overflowToDisk(false); //tokens not writable
Cache newCache = new RefCountCache(cc);
cache = cacheManager.addCacheIfAbsent(newCache);
synchronized (cache) {
if (cache.getStatus() != Status.STATUS_ALIVE) {
cache = cacheManager.addCacheIfAbsent(newCache);
}
if (cache instanceof RefCountCache) {
((RefCountCache)cache).incrementAndGet();
}
}
// Set the TimeToLive value from the CacheConfiguration
ttl = cc.getTimeToLiveSeconds();
}