This module is part of the Apache Sling project.
The JCR base bundle provides JCR utility classes, base implementations for SlingRepository, login administrative allow-list enforcement, repository initializer execution, node type and namespace loading helpers, repository status printer support, and repository mount integration for JCR-based legacy access.
mvn clean package -DskipTests
mvn clean verify
mvn test mvn test -Dtest=LoginAdminAllowListTest mvn test -Dtest=LoginAdminAllowListTest#testAllowList mvn test -Dtest=RepositoryInitializersTest
mvn test jacoco:report
mvn spotless:check mvn apache-rat:check mvn spotless:apply
mvn javadoc:javadoc
org.osgi.service.component.annotations, org.osgi.service.metatype.annotations)jackrabbit-jcr-rmi (provided scope, optional package import)AbstractSlingRepository2 and AbstractSlingRepositoryManager provide the core Sling repository base implementation and lifecycle integration.LoginAdminAllowList, AllowListFragment, and LegacyFragment enforce and bridge loginAdministrative allow-list configuration across modern and legacy property names.SlingRepositoryInitializer services are tracked and executed during repository startup, ordered by OSGi service ranking.NodeTypeLoader and internal.loader.Loader register CND node types and JCR namespaces from bundle headers.org.apache.sling.jcr.base.spi.RepositoryMount and the internal proxy classes support JCR repository mounts through a single active mount selected by service ranking.internal.RepositoryPrinterProvider and internal.RepositoryPrinter expose repository information to the Felix Web Console.util.AccessControlUtil and util.RepositoryAccessor provide reusable JCR access-control and repository lookup utilities.src/main/java - bundle implementation and SPIsrc/test/java - JUnit 4 + Sling testing mockspom.xml - Maven build (Sling bundle parent)bnd.bnd - OSGi manifest instructionsloginAdministrative is protected by an allow list and is disabled unless both repository-manager settings and allow-list rules permit access.
Current configuration uses allow-list naming:
org.apache.sling.jcr.base.LoginAdminAllowListorg.apache.sling.jcr.base.LoginAdminAllowList.fragmentLegacy whitelist PIDs and properties are still supported for backward compatibility, but they are deprecated.
Also supported for backward compatibility:
org.apache.sling.jcr.base.internal.LoginAdminWhitelistorg.apache.sling.jcr.base.internal.LoginAdminWhitelist.fragmentApache Sling provides support for pluggable resource providers. While this allows for a very flexible and efficient integration of custom data providers into Sling, this integration is done on Sling's resource API level. Legacy code which may rely on being able to adapt a resource into a JCR node and continue with JCR API will not work with such a resource provider.
To support legacy code, this bundle provides an SPI interface org.apache.sling.jcr.base.spi.RepositoryMount which extends JackrabbitRepository (and through this javax.jcr.Repository). A service registered as RepositoryMount registers itself with the service registration property RepositoryMount.MOUNT_POINTS_KEY which is a String+ property containing the paths in the JCR tree where the mount takes over the control of the JCR nodes. The RepositoryMount can be registered at a single path or multiple.
The JCR base implementation uses a single active mount. If multiple RepositoryMount services are available, the one with the highest OSGi service ranking is used.
As RepositoryMount extends JackrabbitRepository the implementation of a mount needs to implement the whole JCR API. This is a lot of work compared to a ResourceProvider, therefore a RepositoryMount should only be used if legacy code using JCR API needs to be supported.
When present, the following bundle manifest headers are processed to register repository metadata:
Sling-NodetypesSling-NamespacesServices implementing org.apache.sling.jcr.api.SlingRepositoryInitializer are executed at repository startup before the repository service is registered.
If an initializer throws an exception or error, repository service registration is aborted.