use of org.apache.jackrabbit.oak.spi.commit.BackgroundObserver in project jackrabbit-oak by apache.
the class LuceneIndexProviderService method registerObserver.
private void registerObserver(BundleContext bundleContext, Map<String, ?> config) {
boolean enableAsyncIndexOpen = PropertiesUtil.toBoolean(config.get(PROP_ASYNC_INDEX_OPEN), true);
Observer observer = indexProvider;
if (enableAsyncIndexOpen) {
backgroundObserver = new BackgroundObserver(indexProvider, getExecutorService(), 5);
observer = backgroundObserver;
oakRegs.add(registerMBean(whiteboard, BackgroundObserverMBean.class, backgroundObserver.getMBean(), BackgroundObserverMBean.TYPE, "LuceneIndexConfigObserver queue stats"));
log.info("Registering the LuceneIndexProvider as a BackgroundObserver");
}
regs.add(bundleContext.registerService(Observer.class.getName(), observer, null));
}
Aggregations