Search in sources :

Example 1 with ReflectionMatcher

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);
    }
}
Also used : IndexStatisticsSnapshotImpl(org.infinispan.query.core.stats.impl.IndexStatisticsSnapshotImpl) AggregatedClassLoader(org.infinispan.commons.util.AggregatedClassLoader) InternalCacheRegistry(org.infinispan.registry.InternalCacheRegistry) LocalQueryStatistics(org.infinispan.query.core.stats.impl.LocalQueryStatistics) ReflectionMatcher(org.infinispan.objectfilter.impl.ReflectionMatcher) SearchStatsRetriever(org.infinispan.query.core.stats.impl.SearchStatsRetriever) Cache(org.infinispan.Cache) AdvancedCache(org.infinispan.AdvancedCache)

Example 2 with ReflectionMatcher

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;
}
Also used : ObjectReflectionMatcher(org.infinispan.query.dsl.embedded.impl.ObjectReflectionMatcher) ReflectionMatcher(org.infinispan.objectfilter.impl.ReflectionMatcher) ObjectReflectionMatcher(org.infinispan.query.dsl.embedded.impl.ObjectReflectionMatcher)

Aggregations

ReflectionMatcher (org.infinispan.objectfilter.impl.ReflectionMatcher)2 AdvancedCache (org.infinispan.AdvancedCache)1 Cache (org.infinispan.Cache)1 AggregatedClassLoader (org.infinispan.commons.util.AggregatedClassLoader)1 IndexStatisticsSnapshotImpl (org.infinispan.query.core.stats.impl.IndexStatisticsSnapshotImpl)1 LocalQueryStatistics (org.infinispan.query.core.stats.impl.LocalQueryStatistics)1 SearchStatsRetriever (org.infinispan.query.core.stats.impl.SearchStatsRetriever)1 ObjectReflectionMatcher (org.infinispan.query.dsl.embedded.impl.ObjectReflectionMatcher)1 InternalCacheRegistry (org.infinispan.registry.InternalCacheRegistry)1