]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - org.argeo.slc.repo/src/org/argeo/slc/repo/osgi/ProcessDistribution.java
Massive Argeo APIs refactoring
[gpl/argeo-slc.git] / org.argeo.slc.repo / src / org / argeo / slc / repo / osgi / ProcessDistribution.java
index 7d5d77900536796ec85ae289868a81c218a55067..0c65814255919d620bb08031c178f1f78d6afe24 100644 (file)
@@ -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<? extends NameVersion> it = osgiDistribution
-                                       .nameVersions(); it.hasNext();)
+                       for (Iterator<? extends NameVersion> it = osgiDistribution.nameVersions(); it.hasNext();)
                                processNameVersion(javaSession, it.next());
 
                        // Check sources
-                       for (Iterator<? extends NameVersion> it = osgiDistribution
-                                       .nameVersions(); it.hasNext();) {
+                       for (Iterator<? extends NameVersion> 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) {