Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.2.2
Description
The Jcr class is the entry point for configuring a JCR repository using an Oak backend. However, it always use a hardcoded set of dependencies ( IndexEditorProvider, SecurityProvider, etc ) which cannot be reset, as they are defined in the constructor and the builder with methods eagerly configure the backing Oak instance with those dependencies.
As an example
@Nonnull public final Jcr with(@Nonnull SecurityProvider securityProvider) { oak.with(checkNotNull(securityProvider)); this.securityProvider = securityProvider; return this; }
injects the security provider which in turn starts configuring the Oak repository provider
@Nonnull public Oak with(@Nonnull SecurityProvider securityProvider) { this.securityProvider = checkNotNull(securityProvider); if (securityProvider instanceof WhiteboardAware) { ((WhiteboardAware) securityProvider).setWhiteboard(whiteboard); } for (SecurityConfiguration sc : securityProvider.getConfigurations()) { RepositoryInitializer ri = sc.getRepositoryInitializer(); if (ri != RepositoryInitializer.DEFAULT) { initializers.add(ri); } } return this; }
Instead, the Jcr class should store the configured dependencies and only configure the Oak instance when createRepository is invoked.
Attachments
Attachments
Issue Links
- is related to
-
OAK-2909 Review and improve Oak and Jcr repository setup
-
- Resolved
-