use of org.apache.jackrabbit.oak.osgi.OsgiWhiteboard in project sling by apache.
the class OakSlingRepositoryManager method acquireRepository.
@Override
protected Repository acquireRepository() {
final BundleContext bundleContext = componentContext.getBundleContext();
final Whiteboard whiteboard = new OsgiWhiteboard(bundleContext);
this.indexProvider.start(whiteboard);
this.indexEditorProvider.start(whiteboard);
this.oakExecutorServiceReference = bundleContext.registerService(Executor.class.getName(), new Executor() {
@Override
public void execute(Runnable command) {
threadPool.execute(command);
}
}, new Hashtable<String, Object>());
final Oak oak = new Oak(nodeStore).withAsyncIndexing("async", 5);
final Jcr jcr = new Jcr(oak, false).with(new InitialContent()).with(new ExtraSlingContent()).with(JcrConflictHandler.createJcrConflictHandler()).with(new VersionHook()).with(securityProvider).with(new NameValidatorProvider()).with(new NamespaceEditorProvider()).with(new TypeEditorProvider()).with(new ConflictValidatorProvider()).with(indexProvider).with(indexEditorProvider).with(getDefaultWorkspace()).with(whiteboard).withFastQueryResultSize(true).withObservationQueueLength(configuration.oak_observation_queue_length());
if (commitRateLimiter != null) {
jcr.with(commitRateLimiter);
}
jcr.createContentRepository();
return new TcclWrappingJackrabbitRepository((JackrabbitRepository) jcr.createRepository());
}
use of org.apache.jackrabbit.oak.osgi.OsgiWhiteboard in project jackrabbit-oak by apache.
the class DocumentNodeStoreService method activate.
@Activate
protected void activate(ComponentContext context, Map<String, ?> config) throws Exception {
closer = Closer.create();
this.context = context;
whiteboard = new OsgiWhiteboard(context.getBundleContext());
executor = new WhiteboardExecutor();
executor.start(whiteboard);
maxReplicationLagInSecs = toLong(config.get(PROP_REPLICATION_LAG), DEFAULT_MAX_REPLICATION_LAG);
customBlobStore = toBoolean(prop(CUSTOM_BLOB_STORE), false);
documentStoreType = DocumentStoreType.fromString(PropertiesUtil.toString(config.get(PROP_DS_TYPE), "MONGO"));
registerNodeStoreIfPossible();
}
use of org.apache.jackrabbit.oak.osgi.OsgiWhiteboard in project jackrabbit-oak by apache.
the class SecondaryStoreCacheService method activate.
@Activate
private void activate(BundleContext context, Map<String, Object> config) {
bundleContext = context;
whiteboard = new OsgiWhiteboard(context);
String[] includedPaths = toStringArray(config.get(PROP_INCLUDES), new String[] { "/" });
//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
}
use of org.apache.jackrabbit.oak.osgi.OsgiWhiteboard in project jackrabbit-oak by apache.
the class SecurityProviderImpl method activate.
protected void activate(BundleContext context) {
whiteboard = new OsgiWhiteboard(context);
authorizableActionProvider.start(whiteboard);
authorizableNodeName.start(whiteboard);
restrictionProvider.start(whiteboard);
userAuthenticationFactory.start(whiteboard);
initializeConfigurations();
}
use of org.apache.jackrabbit.oak.osgi.OsgiWhiteboard in project jackrabbit-oak by apache.
the class ExternalLoginModuleFactory method mayRegisterSyncMBean.
private void mayRegisterSyncMBean() {
log.debug("Trying to register SynchronizationMBean");
if (mbeanRegistration != null) {
log.debug("SynchronizationMBean already registered");
return;
}
if (bundleContext == null) {
log.debug("Cannot register SynchronizationMBean; not yet activated.");
return;
}
if (contentRepository == null || securityProvider == null) {
log.debug("Cannot register SynchronizationMBean; waiting for references to ContentRepository|SecurityProvider.");
return;
}
Whiteboard whiteboard = new OsgiWhiteboard(bundleContext);
try {
log.debug("Registering SynchronizationMBean");
String idpName = osgiConfig.getConfigValue(PARAM_IDP_NAME, "");
String sncName = osgiConfig.getConfigValue(PARAM_SYNC_HANDLER_NAME, "");
SyncMBeanImpl bean = new SyncMBeanImpl(contentRepository, securityProvider, syncManager, sncName, idpManager, idpName);
Hashtable<String, String> table = new Hashtable();
table.put("type", "UserManagement");
table.put("name", "External Identity Synchronization Management");
table.put("handler", ObjectName.quote(sncName));
table.put("idp", ObjectName.quote(idpName));
mbeanRegistration = whiteboard.register(SynchronizationMBean.class, bean, ImmutableMap.of("jmx.objectname", new ObjectName("org.apache.jackrabbit.oak", table)));
log.debug("Registration of SynchronizationMBean completed");
} catch (MalformedObjectNameException e) {
log.error("Unable to register SynchronizationMBean", e);
}
}
Aggregations