Search in sources :

Example 1 with InitialContent

use of org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent in project sling by apache.

the class RepositoryTestHelper method createOakRepository.

public static Repository createOakRepository(NodeStore nodeStore) {
    DefaultWhiteboard whiteboard = new DefaultWhiteboard();
    final Oak oak = new Oak(nodeStore).with(new InitialContent()).with(JcrConflictHandler.createJcrConflictHandler()).with(new EditorHook(new VersionEditorProvider())).with(new OpenSecurityProvider()).with(new NamespaceEditorProvider()).with(new TypeEditorProvider()).with(new ConflictValidatorProvider()).with(//getDefaultWorkspace())
    "default").with(whiteboard);
    //        if (commitRateLimiter != null) {
    //            oak.with(commitRateLimiter);
    //        }
    final ContentRepository contentRepository = oak.createContentRepository();
    return new RepositoryImpl(contentRepository, whiteboard, new OpenSecurityProvider(), 1000, null);
}
Also used : InitialContent(org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent) NamespaceEditorProvider(org.apache.jackrabbit.oak.plugins.name.NamespaceEditorProvider) TypeEditorProvider(org.apache.jackrabbit.oak.plugins.nodetype.TypeEditorProvider) DefaultWhiteboard(org.apache.jackrabbit.oak.spi.whiteboard.DefaultWhiteboard) EditorHook(org.apache.jackrabbit.oak.spi.commit.EditorHook) RepositoryImpl(org.apache.jackrabbit.oak.jcr.repository.RepositoryImpl) Oak(org.apache.jackrabbit.oak.Oak) ContentRepository(org.apache.jackrabbit.oak.api.ContentRepository) OpenSecurityProvider(org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider) VersionEditorProvider(org.apache.jackrabbit.oak.plugins.version.VersionEditorProvider) ConflictValidatorProvider(org.apache.jackrabbit.oak.plugins.commit.ConflictValidatorProvider)

Example 2 with InitialContent

use of org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent 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)

Aggregations

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 InitialContent (org.apache.jackrabbit.oak.plugins.nodetype.write.InitialContent)2 Hashtable (java.util.Hashtable)1 Executor (java.util.concurrent.Executor)1 ContentRepository (org.apache.jackrabbit.oak.api.ContentRepository)1 Jcr (org.apache.jackrabbit.oak.jcr.Jcr)1 RepositoryImpl (org.apache.jackrabbit.oak.jcr.repository.RepositoryImpl)1 OsgiWhiteboard (org.apache.jackrabbit.oak.osgi.OsgiWhiteboard)1 NameValidatorProvider (org.apache.jackrabbit.oak.plugins.name.NameValidatorProvider)1 VersionEditorProvider (org.apache.jackrabbit.oak.plugins.version.VersionEditorProvider)1 VersionHook (org.apache.jackrabbit.oak.plugins.version.VersionHook)1 EditorHook (org.apache.jackrabbit.oak.spi.commit.EditorHook)1 OpenSecurityProvider (org.apache.jackrabbit.oak.spi.security.OpenSecurityProvider)1 DefaultWhiteboard (org.apache.jackrabbit.oak.spi.whiteboard.DefaultWhiteboard)1 Whiteboard (org.apache.jackrabbit.oak.spi.whiteboard.Whiteboard)1 BundleContext (org.osgi.framework.BundleContext)1