Apache Sling Feature Model Runtime Creator

Clone this repo:
  1. 28ab300 Adding sonarqube badges as per SLING-9682 by Dan Klco · 3 months ago master
  2. 0754a35 Updating badges for org-apache-sling-feature-r2f by Radu Cotescu · 3 months ago
  3. d0295bd Adding GitHub topics via .asf.yaml by Bertrand Delacretaz · 6 months ago
  4. 620a7e7 ConfigurationAdmin reference managed via OSGi declarative services, by Simo Tripodi · 1 year, 5 months ago
  5. bc024e9 SLING-8583 - [r2f] Lookup bundles ArtifactId in idbsnver.properties and by Simo Tripodi · 1 year, 5 months ago

Apache Sling

Build Status Coverage Sonarcloud Status JavaDoc Maven Central feature License

Running Feature

This is a simple OSGi service which is able to convert, given a BundleContext instance, a currently running OSGi container to an Apache Sling Feature Model definition.

APIs are really simple: it is necessary first to obtain the RuntimeEnvironment2FeatureModel instance from the OSGi Service Registry, then

import org.apache.sling.feature.r2f.*;

@Reference
RuntimeEnvironment2FeatureModel generator;

...
Feature runtimeFeature = generator.getRunningFeature();

Please Note

Currently version will include in the generated Feature Model bundles and configurations only, which are the only informations that can be extracted from a BundleContext instance.

Launch Feature

The RuntimeEnvironment2FeatureModel OSGi service is also able to retrieve the (assembled) Feature used to launch the platform:

import org.apache.sling.feature.r2f.*;

@Reference
RuntimeEnvironment2FeatureModel generator;

...
Feature launchFeature = generator.getLaunchFeature();

## Upgrade Feature

The RuntimeEnvironment2FeatureModel OSGi service is also able to compute the upgrade Feature which prototypes from the Feature used to launch the platform and that targets the runtime Feature:

import org.apache.sling.feature.r2f.*;

@Reference
RuntimeEnvironment2FeatureModel generator;

...
Feature launchFeature = generator.getLaunch2RuntimeUpgradingFeature();

The effective Runtime Feature

Finally, the RuntimeEnvironment2FeatureModel OSGi service is also able to compute the real runtime Feature which is assembled from the Feature used to launch the platform and that targets the runtime Feature:

import org.apache.sling.feature.r2f.*;

@Reference
RuntimeEnvironment2FeatureModel generator;

...
Feature launchFeature = generator.getLaunch2RuntimeUpgradingFeature();