Search in sources :

Example 1 with VersionHook

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());
}
Also used : NamespaceEditorProvider(org.apache.jackrabbit.oak.plugins.name.NamespaceEditorProvider) Hashtable(java.util.Hashtable) VersionHook(org.apache.jackrabbit.oak.plugins.version.VersionHook) NameValidatorProvider(org.apache.jackrabbit.oak.plugins.name.NameValidatorProvider) ConflictValidatorProvider(org.apache.jackrabbit.oak.plugins.commit.ConflictValidatorProvider) InitialContent(org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent) Executor(java.util.concurrent.Executor) OsgiWhiteboard(org.apache.jackrabbit.oak.osgi.OsgiWhiteboard) TypeEditorProvider(org.apache.jackrabbit.oak.plugins.nodetype.TypeEditorProvider) Oak(org.apache.jackrabbit.oak.Oak) Jcr(org.apache.jackrabbit.oak.jcr.Jcr) Whiteboard(org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard) OsgiWhiteboard(org.apache.jackrabbit.oak.osgi.OsgiWhiteboard) BundleContext(org.osgi.framework.BundleContext)

Example 2 with VersionHook

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());
}
Also used : NamespaceEditorProvider(org.apache.jackrabbit.oak.plugins.name.NamespaceEditorProvider) ReferenceEditorProvider(org.apache.jackrabbit.oak.plugins.index.reference.ReferenceEditorProvider) ReferenceIndexProvider(org.apache.jackrabbit.oak.plugins.index.reference.ReferenceIndexProvider) PropertyIndexProvider(org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexProvider) TypeEditorProvider(org.apache.jackrabbit.oak.plugins.nodetype.TypeEditorProvider) PropertyIndexEditorProvider(org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider) VersionHook(org.apache.jackrabbit.oak.plugins.version.VersionHook) ConflictValidatorProvider(org.apache.jackrabbit.oak.plugins.commit.ConflictValidatorProvider) Before(org.junit.Before)

Example 3 with VersionHook

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());
}
Also used : InitialContent(org.apache.jackrabbit.oak.InitialContent) Repository(javax.jcr.Repository) Oak(org.apache.jackrabbit.oak.Oak) VersionHook(org.apache.jackrabbit.oak.plugins.version.VersionHook) RepositoryInitializer(org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer) Properties(java.util.Properties)

Aggregations

VersionHook (org.apache.jackrabbit.oak.plugins.version.VersionHook)3 Oak (org.apache.jackrabbit.oak.Oak)2 ConflictValidatorProvider (org.apache.jackrabbit.oak.plugins.commit.ConflictValidatorProvider)2 NamespaceEditorProvider (org.apache.jackrabbit.oak.plugins.name.NamespaceEditorProvider)2 TypeEditorProvider (org.apache.jackrabbit.oak.plugins.nodetype.TypeEditorProvider)2 Hashtable (java.util.Hashtable)1 Properties (java.util.Properties)1 Executor (java.util.concurrent.Executor)1 Repository (javax.jcr.Repository)1 InitialContent (org.apache.jackrabbit.oak.InitialContent)1 Jcr (org.apache.jackrabbit.oak.jcr.Jcr)1 OsgiWhiteboard (org.apache.jackrabbit.oak.osgi.OsgiWhiteboard)1 PropertyIndexEditorProvider (org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider)1 PropertyIndexProvider (org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexProvider)1 ReferenceEditorProvider (org.apache.jackrabbit.oak.plugins.index.reference.ReferenceEditorProvider)1 ReferenceIndexProvider (org.apache.jackrabbit.oak.plugins.index.reference.ReferenceIndexProvider)1 NameValidatorProvider (org.apache.jackrabbit.oak.plugins.name.NameValidatorProvider)1 InitialContent (org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent)1 RepositoryInitializer (org.apache.jackrabbit.oak.spi.lifecycle.RepositoryInitializer)1 Whiteboard (org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard)1