Create a framework property to merge a specified region with the global region

To make a given region visible to any bundle, even ones that don't
reside in a feature model, the region can be merged with the global
region. This can be useful to enable deprecated APIs for bundles that
don't live in a feature model.
3 files changed
tree: 6f2f10e9ee0f66aed277aa9e6878ca30ce30d3fb
  1. src/
  2. .gitignore
  3. CODE_OF_CONDUCT.md
  4. CONTRIBUTING.md
  5. Jenkinsfile
  6. LICENSE
  7. pom.xml
  8. README.md
README.md

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.

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:

org.apache.sling.feature.apiregions.regions=*

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