private void initializeAndRegisterRepositoryService()

in src/main/java/org/apache/sling/jcr/base/AbstractSlingRepositoryManager.java [558:593]


    private void initializeAndRegisterRepositoryService() {
        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) {
                        stoppingOnError("Exception in a SlingRepositoryInitializer, SlingRepository service registration aborted", e);
                        stop();
                        return;
                    }

                    log.debug("start: calling registerService()");
                    this.repositoryService = registerService();

                    log.debug("start: registerService() successful, registration={}", repositoryService);
                }
            }
        } catch (Throwable e) {
            // consider an uncaught problem an error
            stoppingOnError("start: Uncaught Throwable trying to access Repository, calling stop()", e);
            stop();
        }
    }