use of org.apache.jackrabbit.oak.plugins.version.VersionHook 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.plugins.version.VersionHook in project jackrabbit-oak by apache.
the class AbstractSecurityTest method before.
@Before
public void before() throws Exception {
Oak oak = new Oak().with(new InitialContent()).with(new VersionHook()).with(JcrConflictHandler.createJcrConflictHandler()).with(new NamespaceEditorProvider()).with(new ReferenceEditorProvider()).with(new ReferenceIndexProvider()).with(new PropertyIndexEditorProvider()).with(new PropertyIndexProvider()).with(new TypeEditorProvider()).with(new ConflictValidatorProvider()).with(getQueryEngineSettings()).with(getSecurityProvider());
withEditors(oak);
contentRepository = oak.createContentRepository();
adminSession = login(getAdminCredentials());
root = adminSession.getLatestRoot();
Configuration.setConfiguration(getConfiguration());
}
use of org.apache.jackrabbit.oak.plugins.version.VersionHook in project jackrabbit-oak by apache.
the class RepositoryManager method registerRepository.
private ServiceRegistration registerRepository(BundleContext bundleContext) {
Oak oak = new Oak(store).with(new InitialContent()).with(new VersionHook()).with(JcrConflictHandler.createJcrConflictHandler()).with(whiteboard).with(securityProvider).with(editorProvider).with(indexEditorProvider).with(indexProvider).withFailOnMissingIndexProvider().withAsyncIndexing();
for (RepositoryInitializer initializer : initializers.getServices()) {
oak.with(initializer);
}
if (commitRateLimiter != null) {
oak.with(commitRateLimiter);
}
repository = new OsgiRepository(oak.createContentRepository(), whiteboard, securityProvider, observationQueueLength, commitRateLimiter, fastQueryResultSize);
return bundleContext.registerService(Repository.class.getName(), repository, new Properties());
}
Aggregations