}
private class AfterActivationOrCacheLoader extends ControlledCommandInterceptor {
public AfterActivationOrCacheLoader injectThis(Cache<Object, Object> injectInCache) {
InterceptorChain chain = TestingUtil.extractComponent(injectInCache, InterceptorChain.class);
if (chain.containsInterceptorType(CacheLoaderInterceptor.class)) {
injectInCache.getAdvancedCache().addInterceptorAfter(this, CacheLoaderInterceptor.class);
} else if (chain.containsInterceptorType(ClusteredCacheLoaderInterceptor.class)) {
injectInCache.getAdvancedCache().addInterceptorAfter(this, ClusteredCacheLoaderInterceptor.class);
} else if (chain.containsInterceptorType(ActivationInterceptor.class)) {
injectInCache.getAdvancedCache().addInterceptorAfter(this, ActivationInterceptor.class);
} else if (chain.containsInterceptorType(ClusteredActivationInterceptor.class)) {
injectInCache.getAdvancedCache().addInterceptorAfter(this, ClusteredActivationInterceptor.class);
} else {
throw new IllegalStateException("Should not happen!");
}
return this;