Apache Sling Feature Model Runtime Creator

Clone this repo:
  1. 6733b73 SLING-12094 - Use GitHub for the Maven scm.url value by Robert Munteanu · 7 months ago master
  2. 6a00538 SLING-11709 - Set up Jira autolinks to all Sling Github projects by Robert Munteanu · 1 year, 1 month ago
  3. f536c51 SLING-11051 - Fixing JavaDoc badge by Dan Klco · 2 years, 4 months ago
  4. c60ff19 SLING-10676 - remove SECURITY.md which is not needed by Bertrand Delacretaz · 2 years, 9 months ago
  5. 2d6a0ca SLING-10676 - add or update SECURITY.md by Bertrand Delacretaz · 2 years, 9 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();