X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=org.argeo.slc.repo%2Fsrc%2Forg%2Fargeo%2Fslc%2Frepo%2Fosgi%2FProcessDistribution.java;h=0c65814255919d620bb08031c178f1f78d6afe24;hb=1b8b4c8443356a7a4adc632f391daa8c0ded8053;hp=7d5d77900536796ec85ae289868a81c218a55067;hpb=305ecfa036fac8562fbb3af875c6ecf5822b6dcb;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.repo/src/org/argeo/slc/repo/osgi/ProcessDistribution.java b/org.argeo.slc.repo/src/org/argeo/slc/repo/osgi/ProcessDistribution.java index 7d5d77900..0c6581425 100644 --- a/org.argeo.slc.repo/src/org/argeo/slc/repo/osgi/ProcessDistribution.java +++ b/org.argeo.slc.repo/src/org/argeo/slc/repo/osgi/ProcessDistribution.java @@ -5,8 +5,7 @@ import java.util.Iterator; import javax.jcr.RepositoryException; import javax.jcr.Session; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import org.argeo.api.cms.CmsLog; import org.argeo.jcr.JcrUtils; import org.argeo.slc.CategoryNameVersion; import org.argeo.slc.NameVersion; @@ -18,9 +17,11 @@ import org.argeo.slc.repo.maven.MavenConventionsUtils; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; -/** Executes the processes required so that all managed bundles are available. */ +/** + * Executes the processes required so that all managed bundles are available. + */ public class ProcessDistribution implements Runnable { - private final static Log log = LogFactory.getLog(ProcessDistribution.class); + private final static CmsLog log = CmsLog.getLog(ProcessDistribution.class); private ArgeoOsgiDistribution osgiDistribution; private OsgiFactory osgiFactory; @@ -29,16 +30,14 @@ public class ProcessDistribution implements Runnable { Session javaSession = null; try { javaSession = osgiFactory.openJavaSession(); - for (Iterator it = osgiDistribution - .nameVersions(); it.hasNext();) + for (Iterator it = osgiDistribution.nameVersions(); it.hasNext();) processNameVersion(javaSession, it.next()); // Check sources - for (Iterator it = osgiDistribution - .nameVersions(); it.hasNext();) { + for (Iterator it = osgiDistribution.nameVersions(); it.hasNext();) { CategoryNameVersion nv = (CategoryNameVersion) it.next(); - Artifact artifact = new DefaultArtifact(nv.getCategory(), - nv.getName() + ".source", "jar", nv.getVersion()); + Artifact artifact = new DefaultArtifact(nv.getCategory(), nv.getName() + ".source", "jar", + nv.getVersion()); String path = MavenConventionsUtils.artifactPath("/", artifact); if (!javaSession.itemExists(path)) log.warn("No source available for " + nv); @@ -46,27 +45,23 @@ public class ProcessDistribution implements Runnable { // explicitly create the corresponding modular distribution as we // have here all necessary info. - ModularDistributionFactory mdf = new ModularDistributionFactory( - osgiFactory, osgiDistribution); + ModularDistributionFactory mdf = new ModularDistributionFactory(osgiFactory, osgiDistribution); mdf.run(); } catch (RepositoryException e) { - throw new SlcException("Cannot process distribution " - + osgiDistribution, e); + throw new SlcException("Cannot process distribution " + osgiDistribution, e); } finally { JcrUtils.logoutQuietly(javaSession); } } - protected void processNameVersion(Session javaSession, - NameVersion nameVersion) throws RepositoryException { + protected void processNameVersion(Session javaSession, NameVersion nameVersion) throws RepositoryException { if (log.isTraceEnabled()) log.trace("Check " + nameVersion + "..."); if (!(nameVersion instanceof CategoryNameVersion)) throw new SlcException("Unsupported type " + nameVersion.getClass()); CategoryNameVersion nv = (CategoryNameVersion) nameVersion; - Artifact artifact = new DefaultArtifact(nv.getCategory(), nv.getName(), - "jar", nv.getVersion()); + Artifact artifact = new DefaultArtifact(nv.getCategory(), nv.getName(), "jar", nv.getVersion()); String path = MavenConventionsUtils.artifactPath("/", artifact); if (!javaSession.itemExists(path)) { if (nv instanceof BndWrapper) {