Improve A2 provisioning framework.
[lgpl/argeo-commons.git] / org.argeo.osgi.boot / src / org / argeo / osgi / boot / a2 / OsgiContext.java
index a3ddf55f307d371de7988eb3041bb2a12d7c3784..b4f101887d248075773f5f6cf8fa8dc67c449254 100644 (file)
@@ -6,7 +6,8 @@ import org.osgi.framework.BundleContext;
 import org.osgi.framework.FrameworkUtil;
 import org.osgi.framework.Version;
 
-class OsgiContext extends ProvisioningSource {
+/** A running OSGi bundle context seen as a {@link AbstractProvisioningSource}. */
+class OsgiContext extends AbstractProvisioningSource {
        private final BundleContext bc;
 
        public OsgiContext(BundleContext bc) {
@@ -23,7 +24,7 @@ class OsgiContext extends ProvisioningSource {
        }
 
        void load() {
-               A2Contribution runtimeContribution = new A2Contribution(this, A2Contribution.RUNTIME);
+               A2Contribution runtimeContribution = getOrAddContribution( A2Contribution.RUNTIME);
                for (Bundle bundle : bc.getBundles()) {
                        // OsgiBootUtils.debug(bundle.getDataFile("/"));
                        String componentId = bundle.getSymbolicName();