]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/osgi/ProcessDistribution.java
Improve OSGi factory
[gpl/argeo-slc.git] / runtime / org.argeo.slc.repo / src / main / java / org / argeo / slc / repo / osgi / ProcessDistribution.java
index 26f063991b936f049cdf7ee12f754d3cf1d430ab..982492c99667da69979aee6ade87ad4d4e9e13b6 100644 (file)
@@ -30,8 +30,8 @@ public class ProcessDistribution implements Runnable {
                        Iterator<NameVersion> it = osgiDistribution.nameVersions();
                        while (it.hasNext()) {
                                NameVersion t = it.next();
-                               if (log.isDebugEnabled())
-                                       log.debug("Check " + t + "...");
+                               if (log.isTraceEnabled())
+                                       log.trace("Check " + t + "...");
                                if (!(t instanceof CategorizedNameVersion))
                                        throw new SlcException("Unsupported type " + t.getClass());
                                CategorizedNameVersion nv = (CategorizedNameVersion) t;
@@ -39,13 +39,21 @@ public class ProcessDistribution implements Runnable {
                                                nv.getName(), "jar", nv.getVersion());
                                String path = MavenConventionsUtils.artifactPath("/", artifact);
                                if (!javaSession.itemExists(path)) {
-                                       if (nv instanceof Runnable) {
+                                       // if (nv instanceof Runnable) {
+                                       // if (log.isDebugEnabled())
+                                       // log.debug("Run " + nv + "...");
+                                       // ((Runnable) nv).run();
+                                       // } else
+                                       if (nv instanceof BndWrapper) {
                                                if (log.isDebugEnabled())
-                                                       log.debug("Run " + nv + "...");
-                                               ((Runnable) nv).run();
+                                                       log.debug("Run factory for   : " + nv + "...");
+                                               ((BndWrapper) nv).getFactory().run();
                                        } else {
-                                               log.warn("Skipped unsupported " + nv);
+                                               log.warn("Skip unsupported   : " + nv);
                                        }
+                               } else {
+                                       if (log.isDebugEnabled())
+                                               log.debug("Already available : " + nv);
                                }
                        }
                } catch (RepositoryException e) {