Search in sources :

Example 1 with Loader

use of org.apache.sling.jcr.base.internal.loader.Loader in project sling by apache.

the class AbstractSlingRepositoryManager method initializeAndRegisterRepositoryService.

private void initializeAndRegisterRepositoryService() {
    Throwable t = null;
    try {
        log.debug("start: calling acquireRepository()");
        Repository newRepo = this.acquireRepository();
        if (newRepo != null) {
            // ensure we really have the repository
            log.debug("start: got a Repository");
            this.repository = newRepo;
            synchronized (this.repoInitLock) {
                this.masterSlingRepository = this.create(this.bundleContext.getBundle());
                log.debug("start: setting up Loader");
                this.loader = new Loader(this.masterSlingRepository, this.bundleContext);
                log.debug("start: calling SlingRepositoryInitializer");
                try {
                    executeRepositoryInitializers(this.masterSlingRepository);
                } catch (Throwable e) {
                    t = e;
                    log.error("Exception in a SlingRepositoryInitializer, SlingRepository service registration aborted", t);
                }
                log.debug("start: calling registerService()");
                this.repositoryService = registerService();
                log.debug("start: registerService() successful, registration=" + repositoryService);
            }
        }
    } catch (Throwable e) {
        // consider an uncaught problem an error
        log.error("start: Uncaught Throwable trying to access Repository, calling stopRepository()", e);
        t = e;
    } finally {
        if (t != null) {
            // repository might be partially started, stop anything left
            stop();
        }
    }
}
Also used : SlingRepository(org.apache.sling.jcr.api.SlingRepository) Repository(javax.jcr.Repository) Loader(org.apache.sling.jcr.base.internal.loader.Loader)

Aggregations

Repository (javax.jcr.Repository)1 SlingRepository (org.apache.sling.jcr.api.SlingRepository)1 Loader (org.apache.sling.jcr.base.internal.loader.Loader)1