in src/main/java/org/apache/sling/feature/launcher/impl/FeatureProcessor.java [165:205]
public static void prepareLauncher(final LauncherPrepareContext ctx, final LauncherConfig config,
final Feature app, Map<ArtifactId, Feature> loadedFeatures) throws Exception {
for(final Map.Entry<Integer, List<Artifact>> entry : app.getBundles().getBundlesByStartOrder().entrySet()) {
for(final Artifact a : entry.getValue()) {
final URL artifactFile = ctx.getArtifactFile(a.getId());
// add URL to feature metadata
a.getMetadata().put(URL.class.getName(), artifactFile.toString());
config.getInstallation().addBundle(entry.getKey(), artifactFile);
}
}
for (final Configuration cfg : app.getConfigurations()) {
if (Configuration.isFactoryConfiguration(cfg.getPid())) {
config.getInstallation().addConfiguration(Configuration.getName(cfg.getPid()),
Configuration.getFactoryPid(cfg.getPid()), cfg.getConfigurationProperties());
} else {
config.getInstallation().addConfiguration(cfg.getPid(), null, cfg.getConfigurationProperties());
}
}
for (final Map.Entry<String, String> prop : app.getFrameworkProperties().entrySet()) {
if ( !config.getInstallation().getFrameworkProperties().containsKey(prop.getKey()) ) {
config.getInstallation().getFrameworkProperties().put(prop.getKey(), prop.getValue());
}
}
extensions: for(final Extension ext : app.getExtensions()) {
for (ExtensionHandler handler : ServiceLoader.load(ExtensionHandler.class, FeatureProcessor.class.getClassLoader()))
{
ctx.getLogger().debug("Loaded handler {}", handler.getClass().getName());
if (handler.handle(new ExtensionContextImpl(ctx, config.getInstallation(), loadedFeatures), ext)) {
ctx.getLogger().debug("Handled extension {} with handler {}", ext.getName(), handler.getClass().getName());
continue extensions;
}
}
if ( ext.getState() == ExtensionState.REQUIRED ) {
throw new Exception("Unknown required extension " + ext.getName());
}
}
}