- Iterator<NameVersion> it = osgiDistribution.nameVersions();
- while (it.hasNext()) {
- NameVersion t = it.next();
- if (log.isTraceEnabled())
- log.trace("Check " + t + "...");
- if (!(t instanceof CategorizedNameVersion))
- throw new SlcException("Unsupported type " + t.getClass());
- CategorizedNameVersion nv = (CategorizedNameVersion) t;
- Artifact artifact = new DefaultArtifact(nv.getCategory(),
- nv.getName(), "jar", nv.getVersion());
- String path = MavenConventionsUtils.artifactPath("/", artifact);
- if (!javaSession.itemExists(path)) {
- // 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 factory for : " + nv + "...");
- ((BndWrapper) nv).getFactory().run();
- } else {
- log.warn("Skip unsupported : " + nv);
- }
- } else {
- if (log.isDebugEnabled())
- log.debug("Already available : " + nv);
- }
- }