use of org.infinispan.objectfilter.impl.ReflectionMatcher in project infinispan by infinispan.
the class LifecycleManager method cacheStarting.
@Override
public void cacheStarting(ComponentRegistry cr, Configuration cfg, String cacheName) {
InternalCacheRegistry icr = cr.getGlobalComponentRegistry().getComponent(InternalCacheRegistry.class);
if (!icr.isInternalCache(cacheName) || icr.internalCacheHasFlag(cacheName, Flag.QUERYABLE)) {
cr.registerComponent(new IndexStatisticsSnapshotImpl(), IndexStatistics.class);
cr.registerComponent(new LocalQueryStatistics(), LocalQueryStatistics.class);
cr.registerComponent(new SearchStatsRetriever(), SearchStatsRetriever.class);
AdvancedCache<?, ?> cache = cr.getComponent(Cache.class).getAdvancedCache();
ClassLoader aggregatedClassLoader = makeAggregatedClassLoader(cr.getGlobalComponentRegistry().getGlobalConfiguration().classLoader());
cr.registerComponent(new ReflectionMatcher(aggregatedClassLoader), ReflectionMatcher.class);
cr.registerComponent(new QueryEngine<>(cache), QueryEngine.class);
}
}
use of org.infinispan.objectfilter.impl.ReflectionMatcher in project infinispan by infinispan.
the class ObjectRemoteQueryManager method getQueryEngineForMediaType.
private ObjectRemoteQueryEngine getQueryEngineForMediaType(MediaType mediaType) {
ObjectRemoteQueryEngine queryEngine = enginePerMediaType.get(mediaType.getTypeSubtype());
if (queryEngine == null) {
ReflectionMatcher matcher = mediaType.match(APPLICATION_PROTOSTREAM) ? cr.getComponent(ProtobufObjectReflectionMatcher.class) : cr.getComponent(ObjectReflectionMatcher.class);
queryEngine = new ObjectRemoteQueryEngine(cache, searchMapping != null, matcher.getClass());
enginePerMediaType.put(mediaType.getTypeSubtype(), queryEngine);
}
return queryEngine;
}
Aggregations