GithubHelp home page GithubHelp logo

isabella232 / sling-org-apache-sling-feature-apiregions Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apache/sling-org-apache-sling-feature-apiregions

0.0 0.0 0.0 183 KB

Apache Sling Feature API Regions Runtime

Home Page: https://sling.apache.org/

License: Apache License 2.0

Java 100.00%

sling-org-apache-sling-feature-apiregions's Introduction

Apache Sling

Build Status Test Status Coverage Sonarcloud Status JavaDoc Maven Central feature License

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:

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

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

Additional Configuration

The following framework properties are also recognised:

  • sling.feature.apiregions.default - a comma-separated list of region names. Each bundle installed will be added to these regions, regardless of whether it's installed in a feature or not.
  • sling.feature.apiregions.joinglobal - a comma-separated list of region names. All packages exported by these regions are added to the global region.

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

Key Value
disable if 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

Configuration Files

  • idbsnver.properties contains a mapping from Maven artifact ID to BSN+Version in the following format: groupid:artifactId:version=bsn~1.0.0
  • bundles.properties lists what feature a bundle (by Maven ID) is defined in, could be more than one feature, so the value is comma-separated e.g.: org.sling:mybundles:1=some.other:feature:123,org.sling:something:1.2.3:slingosgifeature:myclassifier
  • features.properties lists for a feature ID what regions this feature is in, also comma separated, e.g: org.sling:myfeature:1.2.3=internal,global
  • regions.properties contains for each region a list of package names that are exported in this region, e.g. global=d.e.f,test,a.b.c

sling-org-apache-sling-feature-apiregions's People

Contributors

bdelacretaz avatar bosschaert avatar buuhuu avatar cziegeler avatar karlpauls avatar klcodanr avatar raducotescu avatar rombert avatar simonetripodi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.