@Override public WriteBehind createWriteBehind() { // THIS IS HAND MADE CODE -- DO NOT GENERATED if (ehcacheNonStopConfiguration != null && ehcacheNonStopConfiguration.isEnabled()) { synchronized (this) { if (writeBehind != null) { throw new IllegalStateException(); } writeBehind = new NonStopWriteBehind(); if (delegate != null) { ((NonStopWriteBehind) writeBehind).init(cache.getCacheManager().createTerracottaWriteBehind(cache)); } return writeBehind; } } writeBehind = cache.getCacheManager().createTerracottaWriteBehind(cache); return writeBehind; }
private void doInit(Callable<TerracottaStore> clusteredStoreCreator) { // THIS IS HAND MADE CODE -- DO NOT GENERATED TerracottaStore delegateTemp = createTerracottaStore(clusteredStoreCreator); if (clusteredCacheInternalContext.getCacheLockProvider() instanceof NonStopCacheLockProvider) { ((NonStopCacheLockProvider) clusteredCacheInternalContext.getCacheLockProvider()) .init((CacheLockProvider) delegateTemp.getInternalContext()); } // create this to be sure that it's present on each node to receive clustered events, // even if this node is not sending out its events cacheEventListener = cache.getCacheManager().createTerracottaEventReplicator(cache); synchronized (this) { if (delegate == null) { this.delegate = delegateTemp; StatisticsManager.associate(this).withChild(delegateTemp); if (writeBehind != null && writeBehind instanceof NonStopWriteBehind) { ((NonStopWriteBehind) writeBehind).init(cache.getCacheManager().createTerracottaWriteBehind(cache)); } } } LOGGER.debug("Initialization Completed for Cache : {}", cache.getName()); }