Class AbstractSlingRepositoryManager


  • @ProviderType
    public abstract class AbstractSlingRepositoryManager
    extends java.lang.Object
    The AbstractSlingRepositoryManager is the basis for controlling the JCR repository instances used by Sling. As a manager it starts and stops the actual repository instance, manages service registration and hands out SlingRepository instances to be used by the consumers.

    This base class controls the livecycle of repository instance whereas implementations of this class provide actual integration into the runtime context. The livecycle of the repository instance is defined as follows:

    To start the repository instance, the implementation calls the start(BundleContext, String, boolean)method which goes through the steps of instantiating the repository, setting things up, and registering the repository as an OSGi service:

    1. acquireRepository()
    2. create(Bundle)
    3. registerService()
    Earlier versions of this class had an additional setup method, whatever code was there can be moved to the create method.

    If starting the repository fails, the method stoppingOnError(String, Throwable) will be called. By default the exception is logged as an error, but this can be customized by overwriting the method.

    To stop the repository instance, the implementation calls the stop() method which goes through the steps of unregistering the OSGi service, tearing all special settings down and finally shutting down the repository:

    1. unregisterService(ServiceRegistration)
    2. destroy(AbstractSlingRepository2)
    3. disposeRepository(Repository)

    Instances of this class manage a single repository instance backing the OSGi service instances. Each consuming bundle, though, gets its own service instance backed by the single actual repository instance managed by this class.

    Since:
    API version 2.3 (bundle version 2.2.2)
    See Also:
    AbstractSlingRepository2
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getDefaultWorkspace()
      Returns the default workspace, which may be null meaning to use the repository provided default workspace.
      boolean isDisableLoginAdministrative()
      Returns whether to disable the SlingRepository.loginAdministrative method or not.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractSlingRepositoryManager

        public AbstractSlingRepositoryManager()
    • Method Detail

      • getDefaultWorkspace

        public final java.lang.String getDefaultWorkspace()
        Returns the default workspace, which may be null meaning to use the repository provided default workspace.
        Returns:
        the default workspace or null indicating the repository's default workspace is actually used.
      • isDisableLoginAdministrative

        public final boolean isDisableLoginAdministrative()
        Returns whether to disable the SlingRepository.loginAdministrative method or not.
        Returns:
        true if SlingRepository.loginAdministrative is disabled.