Apache Sling Feature Model - API Regions Runtime

Clone this repo:
  1. 76d79c6 Update README.md to refer API Regions description by David Bosschaert · 9 weeks ago master
  2. 2bce748 [maven-release-plugin] prepare for next development iteration by David Bosschaert · 4 months ago
  3. d18ad2a [maven-release-plugin] prepare release org.apache.sling.feature.apiregions-1.0.2 by David Bosschaert · 4 months ago org.apache.sling.feature.apiregions-1.0.2
  4. bbb6dd6 SLING-8568 Allow the API Regions runtime to be disabled using dynamic configuration by David Bosschaert · 4 months ago
  5. 656ed45 Make the build work with Java 11 by David Bosschaert · 5 months ago

Build Status Test Status License feature

Apache Sling API Regions runtime component

The API Regions runtime component is implemented as an OSGi Framework Extension bundle. This ensures that the runtime component is always present early in the startup process. For more information about API Regions see https://github.com/apache/sling-org-apache-sling-feature/blob/master/apicontroller.md

This component registers an OSGi resolver hook service which enforces the API regions at runtime. The component looks for properties files that provide the configuration of the API regions. The properties files are generated by the https://github.com/apache/sling-org-apache-sling-feature-extension-apiregions component during the extension post-processing.

As the component has no dependencies on any other component, the properties files are obtained via Framework Properties lookups:

  • sling.feature.apiregions.resource.idbsnver.properties - provides the location of the idbsnver.properties file.
  • sling.feature.apiregions.resource.bundles.properties - provides the location of the bundles.properties file.
  • sling.feature.apiregions.resource.features.properties - provides the location of the features.properties file.
  • sling.feature.apiregions.resource.regions.properties - provides the location of the regions.properties file.

Alternatively, the directory where all of the above files can be found can be specified using one Framework Property instead of using the above framework properties:

  • sling.feature.apiregions.location - provides the location where all properties file can be found. If this property is specified the above properties are not necessary. However if both are provided the file-specific properties take precedence.

File locations are either provided as an absolute file path or by URL. The URL handling mechanism supports one special pseudo-protocol: classloader://. URLs specified with this protocol are passed through the framework classloader's getResource() method to obtain the actual URL.

Enabling / disabling this component

The component is enabled by setting the following framework property:


If this framework property is not set the component will be disabled.

Runtime Configuration

If this component runs in a framework with Configuration Admin present, and it is set to be enabled using the framework property, it can be disabled at runtime through Configuration Admin configuration.

Runtime configuration supported:

PID: org.apache.sling.feature.apiregions.impl

disableif true then the API Regions component is disabled. Otherwise the component is enabled.

No meta type is defined for this configuration since it's not a typical user setting. However, when using the web console the configuration can be created using curl:

curl -u <user>:<pass> -X POST -d "apply=true" -d "propertylist=disable" -d "disable=true" http://localhost:8080/system/console/configMgr/org.apache.sling.feature.apiregions.impl