From: Bruno Sinou Date: Tue, 6 Jan 2015 13:49:36 +0000 (+0000) Subject: Update comments X-Git-Tag: argeo-slc-2.1.7~139 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=8c3ff6111a356792f5ce36e6b51def5f51aea236;p=gpl%2Fargeo-slc.git Update comments git-svn-id: https://svn.argeo.org/slc/trunk@7628 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/ModularDistributionFactory.java b/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/ModularDistributionFactory.java index a2c075e98..79d3b5175 100644 --- a/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/ModularDistributionFactory.java +++ b/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/ModularDistributionFactory.java @@ -47,6 +47,7 @@ public class ModularDistributionFactory implements Runnable { // Constants private final static String CSV_FILE_NAME = "modularDistribution.csv"; + // private final static String FEATURE_FILE_NAME = "feature.xml"; // private static int BUFFER_SIZE = 10240; @@ -85,9 +86,8 @@ public class ModularDistributionFactory implements Runnable { // index osgiFactory.indexNode(distNode); - // Really ? + // We use a specific session. Save before closing javaSession.save(); - } catch (RepositoryException e) { throw new SlcException( "JCR error while persisting modular distribution in JCR " @@ -466,23 +466,6 @@ public class ModularDistributionFactory implements Runnable { } // Helpers - // private Node addModule(Node modules, NameVersion nameVersion) - // throws RepositoryException { - // CategorizedNameVersion cnv = (CategorizedNameVersion) nameVersion; - // Node moduleCoord = null; - // // TODO solve the same name issue - // // if (modules.hasNode(cnv.getName())) - // // moduleCoord = modules.getNode(cnv.getName()); - // // else { - // moduleCoord = modules.addNode(cnv.getName(), - // SlcTypes.SLC_MODULE_COORDINATES); - // moduleCoord.setProperty(SlcNames.SLC_CATEGORY, cnv.getCategory()); - // moduleCoord.setProperty(SlcNames.SLC_NAME, cnv.getName()); - // moduleCoord.setProperty(SlcNames.SLC_VERSION, cnv.getVersion()); - // // } - // return moduleCoord; - // } - private void addToJar(byte[] content, String name, JarOutputStream target) throws IOException { ByteArrayInputStream in = null; @@ -531,8 +514,9 @@ public class ModularDistributionFactory implements Runnable { return builder.toString(); } - public void setJavaSession(Session javaSession) { - this.javaSession = javaSession; + /** Enable dependency injection */ + public void setOsgiFactory(OsgiFactory osgiFactory) { + this.osgiFactory = osgiFactory; } public void setOsgiDistribution(ArgeoOsgiDistribution osgiDistribution) { diff --git a/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/osgi/ProcessDistribution.java b/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/osgi/ProcessDistribution.java index bdb81ae0b..9ea467d77 100644 --- a/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/osgi/ProcessDistribution.java +++ b/runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/osgi/ProcessDistribution.java @@ -33,17 +33,12 @@ public class ProcessDistribution implements Runnable { .nameVersions(); it.hasNext();) processNameVersion(javaSession, it.next()); + // explicitly create the corresponding modular distribution as we + // have here all necessary info. ModularDistributionFactory mdf = new ModularDistributionFactory( 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);