use of org.apache.jackrabbit.oak.osgi.OsgiWhiteboard in project jackrabbit-oak by apache.
the class ConsolidatedListenerMBeanImpl method activate.
//~---------------------------------------< OSGi >
@Activate
private void activate(BundleContext context) {
Whiteboard wb = new OsgiWhiteboard(context);
mbeanReg = registerMBean(wb, ConsolidatedListenerMBean.class, this, ConsolidatedListenerMBean.TYPE, "Consolidated Event Listener statistics");
}
use of org.apache.jackrabbit.oak.osgi.OsgiWhiteboard in project jackrabbit-oak by apache.
the class NodeStateSolrServersObserverService method activate.
@Activate
protected void activate(ComponentContext componentContext) throws Exception {
boolean enabled = PropertiesUtil.toBoolean(componentContext.getProperties().get(ENABLED), false);
if (enabled) {
BundleContext bundleContext = componentContext.getBundleContext();
Whiteboard whiteboard = new OsgiWhiteboard(bundleContext);
executor = new WhiteboardExecutor();
executor.start(whiteboard);
backgroundObserver = new BackgroundObserver(nodeStateSolrServersObserver, executor, 5);
regs.add(bundleContext.registerService(Observer.class.getName(), backgroundObserver, null));
}
}
use of org.apache.jackrabbit.oak.osgi.OsgiWhiteboard in project jackrabbit-oak by apache.
the class Registrations method activate.
@Activate
public void activate(ComponentContext context) throws IOException {
Configuration configuration = new Configuration(context);
if (blobStore == null && configuration.hasCustomBlobStore()) {
log.info("BlobStore enabled. SegmentNodeStore will be initialized once the blob " + "store becomes available");
return;
}
closer = Closer.create();
OsgiWhiteboard whiteboard = new OsgiWhiteboard(context.getBundleContext());
registerSegmentStore(context, blobStore, statisticsProvider, closer, whiteboard, null, true);
}
use of org.apache.jackrabbit.oak.osgi.OsgiWhiteboard in project jackrabbit-oak by apache.
the class SegmentNodeStoreFactory method activate.
@Activate
public void activate(ComponentContext context) throws IOException {
String role = property(ROLE, context);
// In secondaryNodeStore mode customBlobStore is always enabled
boolean isSecondaryStoreMode = "secondary".equals(role);
boolean customBlobStore = Boolean.parseBoolean(property(CUSTOM_BLOB_STORE, context)) || isSecondaryStoreMode;
boolean registerRepositoryDescriptors = Boolean.parseBoolean(property(REGISTER_DESCRIPTORS, context));
log.info("activate: SegmentNodeStore '" + role + "' starting.");
if (blobStore == null && customBlobStore) {
log.info("BlobStore use enabled. SegmentNodeStore would be initialized when BlobStore would be available");
return;
}
if (role != null) {
registrations = Closer.create();
OsgiWhiteboard whiteboard = new OsgiWhiteboard(context.getBundleContext());
final SegmentNodeStore store = SegmentNodeStoreService.registerSegmentStore(context, blobStore, statisticsProvider, registrations, whiteboard, role, registerRepositoryDescriptors);
if (store != null) {
Map<String, Object> props = new HashMap<String, Object>();
props.put(NodeStoreProvider.ROLE, role);
registrations.register(asCloseable(whiteboard.register(NodeStoreProvider.class, new NodeStoreProvider() {
@Override
public NodeStore getNodeStore() {
return store;
}
}, props)));
log.info("Registered NodeStoreProvider backed by SegmentNodeStore of type '{}'", role);
}
}
}
use of org.apache.jackrabbit.oak.osgi.OsgiWhiteboard in project jackrabbit-oak by apache.
the class LuceneIndexProviderService method activate.
@Activate
private void activate(BundleContext bundleContext, Map<String, ?> config) throws NotCompliantMBeanException, IOException {
boolean disabled = PropertiesUtil.toBoolean(config.get(PROP_DISABLED), PROP_DISABLED_DEFAULT);
hybridIndex = PropertiesUtil.toBoolean(config.get(PROP_HYBRID_INDEXING), PROP_DISABLED_DEFAULT);
if (disabled) {
log.info("Component disabled by configuration");
return;
}
configureIndexDefinitionStorage(config);
configureBooleanClauseLimit(config);
initializeFactoryClassLoaders(getClass().getClassLoader());
whiteboard = new OsgiWhiteboard(bundleContext);
threadPoolSize = PropertiesUtil.toInteger(config.get(PROP_THREAD_POOL_SIZE), PROP_THREAD_POOL_SIZE_DEFAULT);
initializeIndexDir(bundleContext, config);
initializeExtractedTextCache(bundleContext, config);
IndexTracker tracker = createTracker(bundleContext, config);
indexProvider = new LuceneIndexProvider(tracker, scorerFactory, augmentorFactory);
if (PROP_DELETED_BLOB_COLLECTION_ENABLED && blobStore != null) {
File blobCollectorWorkingDir = new File(indexDir, "deleted-blobs");
activeDeletedBlobCollector = ActiveDeletedBlobCollectorFactory.newInstance(blobCollectorWorkingDir, executorService);
log.info("Active blob collector initialized at working dir: {}", blobCollectorWorkingDir);
} else {
activeDeletedBlobCollector = ActiveDeletedBlobCollectorFactory.NOOP;
log.info("Active blob collector set to NOOP. Enable? {}; blobStore: {}", PROP_DELETED_BLOB_COLLECTION_ENABLED, blobStore);
}
initializeLogging(config);
initialize();
regs.add(bundleContext.registerService(QueryIndexProvider.class.getName(), indexProvider, null));
registerObserver(bundleContext, config);
registerLocalIndexObserver(bundleContext, tracker, config);
registerIndexEditor(bundleContext, tracker, config);
registerIndexInfoProvider(bundleContext);
oakRegs.add(registerMBean(whiteboard, LuceneIndexMBean.class, new LuceneIndexMBeanImpl(indexProvider.getTracker(), nodeStore, indexPathService, getIndexCheckDir()), LuceneIndexMBean.TYPE, "Lucene Index statistics"));
registerGCMonitor(whiteboard, indexProvider.getTracker());
}
Aggregations