protected void unbindRepository()

in src/main/java/org/apache/sling/jcr/registration/AbstractRegistrationSupport.java [292:314]


    protected void unbindRepository(ServiceReference reference) {
        String name = this.getName(reference);
        if (name != null) {

            synchronized (this.registryLock) {
                // unbind the repository
                Object data = this.registeredRepositories.remove(name);
                if (data != null) {
                    this.unbindRepository(name, data);
                }

                // ensure unregistered from internal and temporary map
                this.repositoryRegistrationBacklog.remove(name);

                // make sure we have no reference to the service
                if (this.componentContext != null) {
                    this.componentContext.getBundleContext().ungetService(reference);
                }
            }
        } else {
            logger.info("Service {} has no name property, not registering", reference.getProperty(Constants.SERVICE_ID));
        }
    }