private void registerTCLoggerIfActive() { if (DSO_ACTIVE) { addConfigChangeListener(new TCLoggerConfigChangeListener()); } }
/** * This method is used for common on-load and instantiation logic. We can't rely on the standard DSO on-load feature * since roots of ClusteredStore are explicitly created in * {@link org.terracotta.modules.ehcache.store.TerracottaClusteredInstanceFactory} through ManagerUtil call, as * opposed to the regular root declaration in DSO instrumented classes. * <p/> * This approach is needed for 'express' features since none of the application context classes can be instrumented by * Terracotta due to the lack of a boot jar. */ public void initalizeTransients(final Ehcache ehcache) { this.cache = ehcache; if (localKeyCacheMaxsize > 0) { keyLookupCache = new ConcurrentHashMap<Object, Object>(); } else { keyLookupCache = null; } this.linkedConfigurations = new CopyOnWriteArraySet<CacheConfiguration>(); ((MutableConfig) backend.getConfig()).addConfigChangeListener(this); backend.initializeTransients(cache.getCacheEventNotificationService()); if (localBufferedMap == null) { localBufferedMap = new LocalBufferedMap<Object, TimestampedValue<Object>>(backend, cacheCoherence, valueModeHandler); } CacheShutdownHook.INSTANCE.registerCache(cache); }