use of org.apache.jackrabbit.oak.spi.filter.PathFilter in project jackrabbit-oak by apache.
the class SecondaryStoreCacheService method activate.
@Activate
private void activate(BundleContext context, Configuration config) {
bundleContext = context;
whiteboard = new OsgiWhiteboard(context);
String[] includedPaths = config.includedPaths();
// TODO Support for exclude is not possible as once a NodeState is loaded from secondary
// store it assumes that complete subtree is in same store. With exclude it would need to
// check for each child access and route to primary
pathFilter = new PathFilter(asList(includedPaths), Collections.<String>emptyList());
SecondaryStoreBuilder builder = new SecondaryStoreBuilder(secondaryStoreProvider.getNodeStore()).differ(differ).metaPropNames(DocumentNodeStore.META_PROP_NAMES).statisticsProvider(statisticsProvider).pathFilter(pathFilter);
SecondaryStoreCache cache = builder.buildCache();
SecondaryStoreObserver observer = builder.buildObserver(cache);
registerObserver(observer, config);
regs.add(bundleContext.registerService(DocumentNodeStateCache.class.getName(), cache, null));
// TODO Need to see OSGi dynamics. Its possible that DocumentNodeStore works after the cache
// gets deregistered but the SegmentNodeState instances might still be in use and that would cause
// failure
}
Aggregations