use of org.infinispan.interceptors.AsyncInterceptorChain in project infinispan by infinispan.
the class SkipIndexingFlagCheckCommandInterceptor method init.
private SkipIndexingFlagCheckCommandInterceptor init() {
AsyncInterceptorChain interceptorChain = extractInterceptorChain(cacheManager.getCache(cacheName));
SkipIndexingFlagCheckCommandInterceptor interceptor = interceptorChain.findInterceptorExtending(SkipIndexingFlagCheckCommandInterceptor.class);
if (interceptor != null)
return interceptor;
SkipIndexingFlagCheckCommandInterceptor ci = new SkipIndexingFlagCheckCommandInterceptor();
interceptorChain.addInterceptor(ci, 1);
return ci;
}
use of org.infinispan.interceptors.AsyncInterceptorChain in project infinispan by infinispan.
the class LifecycleManager method createQueryInterceptorIfNeeded.
private void createQueryInterceptorIfNeeded(ComponentRegistry cr, Configuration cfg, AdvancedCache<?, ?> cache, Map<String, Class<?>> indexedClasses) {
CONTAINER.registeringQueryInterceptor(cache.getName());
BasicComponentRegistry bcr = cr.getComponent(BasicComponentRegistry.class);
ComponentRef<QueryInterceptor> queryInterceptorRef = bcr.getComponent(QueryInterceptor.class);
if (queryInterceptorRef != null) {
// could be already present when two caches share a config
return;
}
ConcurrentMap<GlobalTransaction, Map<Object, Object>> txOldValues = new ConcurrentHashMap<>();
boolean manualIndexing = HS5_CONF_STRATEGY_MANUAL.equals(cfg.indexing().properties().get(HS5_CONF_STRATEGY_PROPERTY));
QueryInterceptor queryInterceptor = new QueryInterceptor(manualIndexing, txOldValues, cache, indexedClasses);
AsyncInterceptorChain ic = bcr.getComponent(AsyncInterceptorChain.class).wired();
EntryWrappingInterceptor wrappingInterceptor = ic.findInterceptorExtending(EntryWrappingInterceptor.class);
ic.addInterceptorBefore(queryInterceptor, wrappingInterceptor.getClass());
bcr.registerComponent(QueryInterceptor.class, queryInterceptor, true);
bcr.addDynamicDependency(AsyncInterceptorChain.class.getName(), QueryInterceptor.class.getName());
if (cfg.transaction().transactionMode().isTransactional()) {
TxQueryInterceptor txQueryInterceptor = new TxQueryInterceptor(txOldValues, queryInterceptor);
ic.addInterceptorBefore(txQueryInterceptor, wrappingInterceptor.getClass());
bcr.registerComponent(TxQueryInterceptor.class, txQueryInterceptor, true);
bcr.addDynamicDependency(AsyncInterceptorChain.class.getName(), TxQueryInterceptor.class.getName());
}
}
use of org.infinispan.interceptors.AsyncInterceptorChain in project infinispan by infinispan.
the class FlagCheckCommandInterceptor method init.
private FlagCheckCommandInterceptor init() {
AsyncInterceptorChain interceptorChain = cacheManager.getCache(cacheName).getAdvancedCache().getAsyncInterceptorChain();
FlagCheckCommandInterceptor interceptor = interceptorChain.findInterceptorExtending(FlagCheckCommandInterceptor.class);
if (interceptor != null)
return interceptor;
FlagCheckCommandInterceptor ci = new FlagCheckCommandInterceptor();
interceptorChain.addInterceptor(ci, 1);
return ci;
}
Aggregations