[ 
https://issues.apache.org/jira/browse/SLING-7970?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16651592#comment-16651592
 ] 

ASF GitHub Bot commented on SLING-7970:
---------------------------------------

bosschaert closed pull request #4: SLING-7970 Add Feature Model introspection 
Service API
URL: https://github.com/apache/sling-org-apache-sling-feature-launcher/pull/4
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/pom.xml b/pom.xml
index 9debaf3..67dfb97 100644
--- a/pom.xml
+++ b/pom.xml
@@ -93,6 +93,11 @@
             <version>2.6</version>
             <scope>provided</scope>
         </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.annotation.versioning</artifactId>
+            <scope>provided</scope>
+        </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>osgi.core</artifactId>
diff --git 
a/src/main/java/org/apache/sling/feature/launcher/impl/FeatureProcessor.java 
b/src/main/java/org/apache/sling/feature/launcher/impl/FeatureProcessor.java
index dd5c2bb..018f1ea 100644
--- a/src/main/java/org/apache/sling/feature/launcher/impl/FeatureProcessor.java
+++ b/src/main/java/org/apache/sling/feature/launcher/impl/FeatureProcessor.java
@@ -19,6 +19,7 @@
 import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
+import java.io.StringWriter;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -42,6 +43,7 @@
 import org.apache.sling.feature.io.file.ArtifactHandler;
 import org.apache.sling.feature.io.file.ArtifactManager;
 import org.apache.sling.feature.io.json.FeatureJSONReader;
+import org.apache.sling.feature.io.json.FeatureJSONWriter;
 import org.apache.sling.feature.launcher.spi.LauncherPrepareContext;
 import org.apache.sling.feature.launcher.spi.extensions.ExtensionHandler;
 
@@ -120,7 +122,7 @@ public static void prepareLauncher(final 
LauncherPrepareContext ctx, final Launc
             for(final Artifact a : entry.getValue()) {
                 final File artifactFile = ctx.getArtifactFile(a.getId());
 
-                config.getInstallation().addBundle(entry.getKey(), 
artifactFile);
+                config.getInstallation().addBundle(entry.getKey(), 
a.getId().toMvnId(), artifactFile);
             }
         }
 
@@ -138,6 +140,10 @@ public static void prepareLauncher(final 
LauncherPrepareContext ctx, final Launc
             }
         }
 
+        StringWriter featureStringWriter = new StringWriter();
+        FeatureJSONWriter.write(featureStringWriter, app);
+        
config.getInstallation().setEffectiveFeature(featureStringWriter.toString());
+
         extensions: for(final Extension ext : app.getExtensions()) {
             for (ExtensionHandler handler : 
ServiceLoader.load(ExtensionHandler.class,  
FeatureProcessor.class.getClassLoader()))
             {
diff --git 
a/src/main/java/org/apache/sling/feature/launcher/impl/Installation.java 
b/src/main/java/org/apache/sling/feature/launcher/impl/Installation.java
index 3f08856..3fa11d3 100644
--- a/src/main/java/org/apache/sling/feature/launcher/impl/Installation.java
+++ b/src/main/java/org/apache/sling/feature/launcher/impl/Installation.java
@@ -23,6 +23,7 @@
 import java.util.ArrayList;
 import java.util.Dictionary;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -35,7 +36,7 @@
     private final Map<String, String> fwkProperties = new HashMap<>();
 
     /** Bundle map */
-    private final Map<Integer, List<File>> bundleMap = new HashMap<>();
+    private final Map<Integer, Map<String, File>> bundleMap = new HashMap<>();
 
     /** Artifacts to be installed */
     private final List<File> installables = new ArrayList<>();
@@ -46,6 +47,9 @@
     /** The list of app jars. */
     private final List<File> appJars = new ArrayList<>();
 
+    /** The effective, merged feature used to launch. */
+    private String effectiveFeature;
+
     /**
      * Add an application jar.
      * @param jar The application jar
@@ -65,15 +69,17 @@ public void addAppJar(final File jar) {
     /**
      * Add a bundle with the given start level
      * @param startLevel The start level
+     * @param id The artifact ID for the bundle
      * @param file The bundle file
      */
-    public void addBundle(final Integer startLevel, final File file) {
-        List<File> files = bundleMap.get(startLevel);
+    @Override
+    public void addBundle(final Integer startLevel, final String id, final 
File file) {
+        Map<String, File> files = bundleMap.get(startLevel);
         if ( files == null ) {
-            files = new ArrayList<>();
+            files = new LinkedHashMap<>();
             bundleMap.put(startLevel, files);
         }
-        files.add(file);
+        files.put(id, file);
     }
 
     /**
@@ -112,7 +118,7 @@ public void addFrameworkProperty(String key, String value)
      * @see 
org.apache.sling.feature.launcher.spi.LauncherRunContext#getBundleMap()
      */
     @Override
-    public Map<Integer, List<File>> getBundleMap() {
+    public Map<Integer, Map<String, File>> getBundleMap() {
         return this.bundleMap;
     }
 
@@ -132,6 +138,22 @@ public void addFrameworkProperty(String key, String value)
         return this.installables;
     }
 
+    /**
+     * @see 
org.apache.sling.feature.launcher.spi.LauncherRunContext#getEffectiveFeature()
+     */
+    @Override
+    public String getEffectiveFeature() {
+        return effectiveFeature;
+    }
+
+    /**
+     * Set the effective feature JSON text
+     * @param featureJsonText
+     */
+    public void setEffectiveFeature(String featureJsonText) {
+        effectiveFeature = featureJsonText;
+    }
+
     /**
      * Clear all in-memory objects
      */
@@ -140,5 +162,6 @@ public void clear() {
         this.fwkProperties.clear();
         this.bundleMap.clear();
         this.installables.clear();
+        this.effectiveFeature = null;
     }
 }
diff --git 
a/src/main/java/org/apache/sling/feature/launcher/impl/launchers/AbstractRunner.java
 
b/src/main/java/org/apache/sling/feature/launcher/impl/launchers/AbstractRunner.java
index f532a2c..9d2e65d 100644
--- 
a/src/main/java/org/apache/sling/feature/launcher/impl/launchers/AbstractRunner.java
+++ 
b/src/main/java/org/apache/sling/feature/launcher/impl/launchers/AbstractRunner.java
@@ -17,6 +17,10 @@
 package org.apache.sling.feature.launcher.impl.launchers;
 
 import org.apache.sling.feature.launcher.impl.Main;
+import org.apache.sling.feature.launcher.service.Bundles;
+import org.apache.sling.feature.launcher.service.Features;
+import org.apache.sling.feature.launcher.service.impl.BundlesImpl;
+import org.apache.sling.feature.launcher.service.impl.FeaturesImpl;
 import org.apache.sling.launchpad.api.LaunchpadContentProvider;
 import org.apache.sling.launchpad.api.StartupHandler;
 import org.apache.sling.launchpad.api.StartupMode;
@@ -43,11 +47,13 @@
 import java.net.JarURLConnection;
 import java.net.URL;
 import java.net.URLConnection;
+import java.util.AbstractMap;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Dictionary;
 import java.util.Enumeration;
+import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
@@ -100,7 +106,8 @@ public AbstractRunner(final Map<String, String> 
frameworkProperties, final List<
         }
     }
 
-    protected void setupFramework(final Framework framework, final 
Map<Integer, List<File>> bundlesMap)
+    protected void setupFramework(final Framework framework, final 
Map<Integer, Map<String, File>> bundlesMap,
+            String effectiveFeature)
     throws BundleException {
         if ( !configurations.isEmpty() ) {
             this.configAdminTracker = new 
ServiceTracker<>(framework.getBundleContext(),
@@ -165,8 +172,9 @@ public void removedService(ServiceReference<Object> 
reference, Object service) {
             this.installerTracker.open();
         }
 
+        Map<Map.Entry<String, String>, String> bundleMap = null;
         try {
-            this.install(framework, bundlesMap);
+            bundleMap = this.install(framework, bundlesMap);
         } catch ( final IOException ioe) {
             throw new BundleException("Unable to install bundles.", ioe);
         }
@@ -274,6 +282,9 @@ public InputStream getResourceAsStream(String path) {
         } catch (NoClassDefFoundError ex) {
             // Ignore, we don't have the launchpad.api
         }
+
+        framework.getBundleContext().registerService(Bundles.class, new 
BundlesImpl(bundleMap), null);
+        framework.getBundleContext().registerService(Features.class, new 
FeaturesImpl(effectiveFeature), null);
     }
 
     protected boolean startFramework(final Framework framework, long timeout, 
TimeUnit unit) throws BundleException, InterruptedException
@@ -386,20 +397,26 @@ private String getFragmentHostHeader(final Bundle b) {
      * @param bundleMap The map with the bundles indexed by start level
      * @throws IOException, BundleException If anything goes wrong.
      */
-    private void install(final Framework framework, final Map<Integer, 
List<File>> bundleMap)
+    private Map<Map.Entry<String, String>, String> install(final Framework 
framework, final Map<Integer, Map<String, File>> bundleMap)
     throws IOException, BundleException {
+        final Map<Map.Entry<String, String>, String> mapping = new HashMap<>();
         final BundleContext bc = framework.getBundleContext();
-        int defaultStartLevel = getProperty(bc, "felix.startlevel.bundle", 1);
+        final int defaultStartLevel = getProperty(bc, 
"felix.startlevel.bundle", 1);
         for(final Integer startLevel : sortStartLevels(bundleMap.keySet(), 
defaultStartLevel)) {
             Main.LOG().debug("Installing bundles with start level {}", 
startLevel);
 
-            for(final File file : bundleMap.get(startLevel)) {
+            for(final Map.Entry<String, File> entry : 
bundleMap.get(startLevel).entrySet()) {
+                File file = entry.getValue();
                 Main.LOG().debug("- {}", file.getName());
 
                 // use reference protocol. This avoids copying the binary to 
the cache directory
                 // of the framework
                 final Bundle bundle = bc.installBundle("reference:" + 
file.toURI().toURL(), null);
 
+                // Record the mapping of the feature model bundle artifact ID 
to the Bundle Symbolic Name and Version
+                mapping.put(new AbstractMap.SimpleEntry<String, String>(
+                        bundle.getSymbolicName(), 
bundle.getVersion().toString()), entry.getKey());
+
                 // fragment?
                 if ( !isSystemBundleFragment(bundle) && 
getFragmentHostHeader(bundle) == null ) {
                     if ( startLevel > 0 ) {
@@ -409,6 +426,7 @@ private void install(final Framework framework, final 
Map<Integer, List<File>> b
                 }
             }
         }
+        return mapping;
     }
 
     /**
diff --git 
a/src/main/java/org/apache/sling/feature/launcher/impl/launchers/FrameworkLauncher.java
 
b/src/main/java/org/apache/sling/feature/launcher/impl/launchers/FrameworkLauncher.java
index fb2dac2..bd53d7a 100644
--- 
a/src/main/java/org/apache/sling/feature/launcher/impl/launchers/FrameworkLauncher.java
+++ 
b/src/main/java/org/apache/sling/feature/launcher/impl/launchers/FrameworkLauncher.java
@@ -44,6 +44,15 @@
     public void prepare(final LauncherPrepareContext context,
             final ArtifactId frameworkId,
             final Feature app) throws Exception {
+        String extraPackages = 
app.getFrameworkProperties().get(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA);
+        if (extraPackages != null && !extraPackages.trim().isEmpty()) {
+            extraPackages = extraPackages + ",";
+        }
+        else {
+            extraPackages = "";
+        }
+        extraPackages += 
"org.apache.sling.feature.launcher.service;version=\"0.1.0\"";
+
         context.addAppJar(context.getArtifactFile(frameworkId));
         ArtifactId api = 
ArtifactId.fromMvnId("org.apache.sling:org.apache.sling.launchpad.api:1.2.0");
         Artifact artifact = app.getBundles().getSame(api);
@@ -52,16 +61,11 @@ public void prepare(final LauncherPrepareContext context,
             api = artifact.getId();
             context.addAppJar(context.getArtifactFile(api));
             app.getBundles().removeExact(api);
-            String extra = 
app.getFrameworkProperties().get(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA);
-            if (extra != null && !extra.trim().isEmpty()) {
-                extra = extra + ",";
-            }
-            else {
-                extra = "";
-            }
-            extra = extra + "org.apache.sling.launchpad.api;version=\"" + 
api.getOSGiVersion() + "\"";
-            
app.getFrameworkProperties().put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, 
extra);
+
+            extraPackages = extraPackages + 
",org.apache.sling.launchpad.api;version=\"" + api.getOSGiVersion() + "\"";
         }
+
+        
app.getFrameworkProperties().put(Constants.FRAMEWORK_SYSTEMPACKAGES_EXTRA, 
extraPackages);
     }
 
     /**
@@ -87,11 +91,12 @@ public String lookup(String key) {
         context.getFrameworkProperties().forEach((key, value) -> {
             properties.put(key, ss.replace(value).replace("{dollar}", "$"));
         });
+
         if ( Main.LOG().isDebugEnabled() ) {
             Main.LOG().debug("Bundles:");
             for(final Integer key : context.getBundleMap().keySet()) {
                 Main.LOG().debug("-- Start Level {}", key);
-                for(final File f : context.getBundleMap().get(key)) {
+                for(final File f : context.getBundleMap().get(key).values()) {
                     Main.LOG().debug("  - {}", f.getName());
                 }
             }
@@ -111,12 +116,13 @@ public String lookup(String key) {
         }
 
         final Class<?> runnerClass = 
cl.loadClass(FrameworkRunner.class.getName());
-        final Constructor<?> constructor = 
runnerClass.getDeclaredConstructor(Map.class, Map.class, List.class, 
List.class);
+        final Constructor<?> constructor = 
runnerClass.getDeclaredConstructor(Map.class, Map.class, List.class, 
List.class, String.class);
         constructor.setAccessible(true);
         Callable<Integer> restart = (Callable<Integer>) 
constructor.newInstance(properties,
                 context.getBundleMap(),
                 context.getConfigurations(),
-                context.getInstallableArtifacts());
+                context.getInstallableArtifacts(),
+                context.getEffectiveFeature());
 
         return restart.call();
         // nothing else to do, constructor starts everything
diff --git 
a/src/main/java/org/apache/sling/feature/launcher/impl/launchers/FrameworkRunner.java
 
b/src/main/java/org/apache/sling/feature/launcher/impl/launchers/FrameworkRunner.java
index 25ce117..c8af44c 100644
--- 
a/src/main/java/org/apache/sling/feature/launcher/impl/launchers/FrameworkRunner.java
+++ 
b/src/main/java/org/apache/sling/feature/launcher/impl/launchers/FrameworkRunner.java
@@ -37,9 +37,10 @@
     private volatile int type = -1;
 
     public FrameworkRunner(final Map<String, String> frameworkProperties,
-            final Map<Integer, List<File>> bundlesMap,
+            final Map<Integer, Map<String, File>> bundlesMap,
             final List<Object[]> configurations,
-            final List<File> installables) throws Exception {
+            final List<File> installables,
+            final String effectiveFeature) throws Exception {
         super(frameworkProperties, configurations, installables);
 
         final ServiceLoader<FrameworkFactory> loader = 
ServiceLoader.load(FrameworkFactory.class);
@@ -78,7 +79,7 @@ public void run() {
             }
         });
 
-        this.setupFramework(framework, bundlesMap);
+        this.setupFramework(framework, bundlesMap, effectiveFeature);
 
 
         long time = System.currentTimeMillis();
diff --git 
a/src/main/java/org/apache/sling/feature/launcher/service/Bundles.java 
b/src/main/java/org/apache/sling/feature/launcher/service/Bundles.java
new file mode 100644
index 0000000..e440ed8
--- /dev/null
+++ b/src/main/java/org/apache/sling/feature/launcher/service/Bundles.java
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.feature.launcher.service;
+
+/**
+ * This service provides information about bundles in the feature model.
+ */
+public interface Bundles {
+    /**
+     * Obtain the Artifact ID for a given bundle, identified by its
+     * Symbolic Name and version.
+     * @param bsn The symbolic name of the bundle.
+     * @param ver The version of the bundle.
+     * @return The artifact ID.
+     */
+    String getBundleArtifact(String bsn, String ver);
+}
diff --git 
a/src/main/java/org/apache/sling/feature/launcher/service/Features.java 
b/src/main/java/org/apache/sling/feature/launcher/service/Features.java
new file mode 100644
index 0000000..402a654
--- /dev/null
+++ b/src/main/java/org/apache/sling/feature/launcher/service/Features.java
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.feature.launcher.service;
+
+/**
+ * The Features service provides information over Features at runtime.
+ */
+public interface Features {
+    /**
+     * Returns the effective feature as JSON text.
+     * @return The effective feature.
+     */
+    String getEffectiveFeature();
+}
diff --git 
a/src/main/java/org/apache/sling/feature/launcher/service/impl/BundlesImpl.java 
b/src/main/java/org/apache/sling/feature/launcher/service/impl/BundlesImpl.java
new file mode 100644
index 0000000..21099fd
--- /dev/null
+++ 
b/src/main/java/org/apache/sling/feature/launcher/service/impl/BundlesImpl.java
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.feature.launcher.service.impl;
+
+import org.apache.sling.feature.launcher.service.Bundles;
+
+import java.util.AbstractMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+public class BundlesImpl implements Bundles {
+    private final Map<Map.Entry<String, String>, String> bundleMap;
+
+    public BundlesImpl(Map<Entry<String, String>, String> bm) {
+        bundleMap = bm;
+    }
+
+    @Override
+    public String getBundleArtifact(String bsn, String ver) {
+        return bundleMap.get(new AbstractMap.SimpleEntry<String, String>(bsn, 
ver));
+    }
+}
diff --git 
a/src/main/java/org/apache/sling/feature/launcher/service/impl/FeaturesImpl.java
 
b/src/main/java/org/apache/sling/feature/launcher/service/impl/FeaturesImpl.java
new file mode 100644
index 0000000..4990387
--- /dev/null
+++ 
b/src/main/java/org/apache/sling/feature/launcher/service/impl/FeaturesImpl.java
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.feature.launcher.service.impl;
+
+import org.apache.sling.feature.launcher.service.Features;
+
+public class FeaturesImpl implements Features {
+    private final String effectiveFeature;
+
+    public FeaturesImpl(String feat) {
+        effectiveFeature = feat;
+    }
+
+    @Override
+    public String getEffectiveFeature() {
+        return effectiveFeature;
+    }
+}
diff --git 
a/src/main/java/org/apache/sling/feature/launcher/service/package-info.java 
b/src/main/java/org/apache/sling/feature/launcher/service/package-info.java
new file mode 100644
index 0000000..97641a4
--- /dev/null
+++ b/src/main/java/org/apache/sling/feature/launcher/service/package-info.java
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+@org.osgi.annotation.versioning.Version("0.1.0")
+package org.apache.sling.feature.launcher.service;
+
+
diff --git 
a/src/main/java/org/apache/sling/feature/launcher/spi/LauncherRunContext.java 
b/src/main/java/org/apache/sling/feature/launcher/spi/LauncherRunContext.java
index 20c95a9..481d94f 100644
--- 
a/src/main/java/org/apache/sling/feature/launcher/spi/LauncherRunContext.java
+++ 
b/src/main/java/org/apache/sling/feature/launcher/spi/LauncherRunContext.java
@@ -32,10 +32,11 @@
     Map<String, String> getFrameworkProperties();
 
     /**
-     * Bundle map, key is the start level, value is a list of files.
+     * Bundle map, key is the start level, value is a map of bundle artifact
+     * ID and the local file where the bundle can be found.
      * @return The bundle map, might be empty
      */
-    Map<Integer, List<File>> getBundleMap();
+    Map<Integer, Map<String, File>> getBundleMap();
 
     /**
      * List of configurations.
@@ -55,4 +56,10 @@
      * @return The list of files. The list might be empty.
      */
     List<File> getInstallableArtifacts();
+
+    /**
+     * Obtain the effective Feature JSON
+     * @return The effective Feature JSON as a String.
+     */
+    String getEffectiveFeature();
 }
diff --git 
a/src/main/java/org/apache/sling/feature/launcher/spi/extensions/ExtensionInstallationContext.java
 
b/src/main/java/org/apache/sling/feature/launcher/spi/extensions/ExtensionInstallationContext.java
index 5efd7b7..d3da33d 100644
--- 
a/src/main/java/org/apache/sling/feature/launcher/spi/extensions/ExtensionInstallationContext.java
+++ 
b/src/main/java/org/apache/sling/feature/launcher/spi/extensions/ExtensionInstallationContext.java
@@ -23,7 +23,13 @@
 
 public interface ExtensionInstallationContext extends LauncherRunContext
 {
-    public void addBundle(final Integer startLevel, final File file);
+    /**
+     * Add a bundle with the given start level
+     * @param startLevel The start level
+     * @param id The artifact ID for the bundle
+     * @param file The bundle file
+     */
+    public void addBundle(final Integer startLevel, final String artifactId, 
final File file);
 
     /**
      * Add an artifact to be installed by the installer


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add Feature Model introspection service
> ---------------------------------------
>
>                 Key: SLING-7970
>                 URL: https://issues.apache.org/jira/browse/SLING-7970
>             Project: Sling
>          Issue Type: New Feature
>          Components: Feature Model
>            Reporter: David Bosschaert
>            Assignee: David Bosschaert
>            Priority: Major
>
> We need a service that can report on the feature model that is launched by 
> the launcher, for introspection purposes.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to