]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/osgi/ProcessDistribution.java
Add BSD License.
[gpl/argeo-slc.git] / runtime / org.argeo.slc.repo / src / main / java / org / argeo / slc / repo / osgi / ProcessDistribution.java
index 544b1c634aa38e2fd6539be2850395ee580fcbd3..9ea467d773d9d5a507ad6e60b835d9cc6c49b7fa 100644 (file)
@@ -29,22 +29,16 @@ public class ProcessDistribution implements Runnable {
                Session javaSession = null;
                try {
                        javaSession = osgiFactory.openJavaSession();
-
                        for (Iterator<? extends NameVersion> it = osgiDistribution
                                        .nameVersions(); it.hasNext();)
                                processNameVersion(javaSession, it.next());
 
+                       // explicitly create the corresponding modular distribution as we
+                       // have here all necessary info.
                        ModularDistributionFactory mdf = new ModularDistributionFactory(
-                                       javaSession, osgiDistribution);
+                                       osgiFactory, osgiDistribution);
                        mdf.run();
 
-                       // TODO why is the created distribution not automatically indexed?
-                       // osgiFactory.indexNode(node);
-                       // javaSession.save();
-
-                       // Node artifact = createDistributionArtifact(javaSession,
-                       // osgiDistribution);
-
                } catch (RepositoryException e) {
                        throw new SlcException("Cannot process distribution "
                                        + osgiDistribution, e);
@@ -68,12 +62,14 @@ public class ProcessDistribution implements Runnable {
                                if (log.isDebugEnabled())
                                        log.debug("Run factory for   : " + nv + "...");
                                ((BndWrapper) nv).getFactory().run();
+                       } else if (nv instanceof Runnable) {
+                               ((Runnable) nv).run();
                        } else {
                                log.warn("Skip unsupported   : " + nv);
                        }
                } else {
-                       if (log.isDebugEnabled())
-                               log.debug("Already available : " + nv);
+                       if (log.isTraceEnabled())
+                               log.trace("Already available : " + nv);
                }
        }