Improve OSGi factory
authorMathieu Baudier <mbaudier@argeo.org>
Fri, 4 Oct 2013 12:04:39 +0000 (12:04 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Fri, 4 Oct 2013 12:04:39 +0000 (12:04 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@6535 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

14 files changed:
runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/DefaultExecutionFlow.java
runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/generator/RunnableCallFlow.java
runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/ArtifactDistribution.java
runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/osgi/ArchiveWrapper.java
runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/osgi/ArgeoOsgiDistribution.java
runtime/org.argeo.slc.repo/src/main/java/org/argeo/slc/repo/osgi/BndWrapper.java
runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/CategorizedNameVersion.java [new file with mode: 0644]
runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/ModuleSet.java [new file with mode: 0644]
runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/build/ModularDistribution.java
runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/execution/ExecutionFlow.java
runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/OsgiBundle.java
runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/OsgiExecutionModulesManager.java
runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/build/AbstractOsgiModularDistribution.java
runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/build/BundleModularDistribution.java

index 1f4601c840b361773510505362c8392647b456a7..535c42dad7224fdded4a561e864ec801f768d67f 100644 (file)
@@ -17,6 +17,7 @@ package org.argeo.slc.core.execution;
 
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -132,6 +133,26 @@ public class DefaultExecutionFlow implements ExecutionFlow, InitializingBean,
                }
        }
 
+       /**
+        * List sub-runnables that would be executed if run() method would be
+        * called.
+        */
+       public Iterator<Runnable> runnables() {
+               return executables.iterator();
+       }
+
+       /**
+        * If there is one and only one runnable wrapped return it, throw an
+        * exeception otherwise.
+        */
+       public Runnable getRunnable() {
+               if (executables.size() == 1)
+                       return executables.get(0);
+               else
+                       throw new SlcException("There are " + executables.size()
+                                       + " runnables in flow " + getName());
+       }
+
        public void doExecuteRunnable(Runnable runnable) {
                runnable.run();
        }
index 0065b18ccbbc369b79ff7e9caeeaa6e2ed151fc0..695606c210f803dafda009d5f97c18b078e72f32 100644 (file)
@@ -15,6 +15,8 @@
  */\r
 package org.argeo.slc.core.execution.generator;\r
 \r
+import java.util.ArrayList;\r
+import java.util.Iterator;\r
 import java.util.List;\r
 import java.util.Map;\r
 \r
@@ -142,8 +144,8 @@ public class RunnableCallFlow implements ExecutionFlow, ApplicationContextAware
                try {\r
                        for (int callIndex = 0; callIndex < runnableCalls.size(); ++callIndex) {\r
                                RunnableCall runnableCall = runnableCalls.get(callIndex);\r
-                               Object bean = applicationContext.getBean(runnableCall\r
-                                               .getBeanName(), Runnable.class);\r
+                               Object bean = applicationContext.getBean(\r
+                                               runnableCall.getBeanName(), Runnable.class);\r
                                if (log.isDebugEnabled())\r
                                        log.debug("Running flow '" + runnableCall.getBeanName()\r
                                                        + "'");\r
@@ -164,11 +166,30 @@ public class RunnableCallFlow implements ExecutionFlow, ApplicationContextAware
                }\r
        }\r
 \r
+       public Iterator<Runnable> runnables() {\r
+               List<Runnable> runnables = new ArrayList<Runnable>();\r
+               for (int callIndex = 0; callIndex < runnableCalls.size(); ++callIndex) {\r
+                       RunnableCall runnableCall = runnableCalls.get(callIndex);\r
+                       Object bean = applicationContext.getBean(\r
+                                       runnableCall.getBeanName(), Runnable.class);\r
+                       runnables.add((Runnable) bean);\r
+               }\r
+               return runnables.iterator();\r
+       }\r
+\r
+       public Runnable getRunnable() {\r
+               if (runnableCalls.size() == 1)\r
+                       return runnables().next();\r
+               else\r
+                       throw new SlcException("There are " + runnableCalls.size()\r
+                                       + " runnables in flow " + getName());\r
+       }\r
+\r
        @Override\r
        public String toString() {\r
                return new StringBuffer("RunnableCallFlow ").append(name).toString();\r
-       }       \r
-       \r
+       }\r
+\r
        public ExecutionSpec getExecutionSpec() {\r
                return executionSpec;\r
        }\r
index 4cd673eb4d259061de68c778b2451090d2a6281b..d76da463a044b06b8afbb56658bcce4e8486fe5f 100644 (file)
@@ -1,20 +1,17 @@
 package org.argeo.slc.repo;
 
-import org.argeo.slc.DefaultNameVersion;
-import org.argeo.slc.NameVersion;
+import org.argeo.slc.CategorizedNameVersion;
 import org.argeo.slc.build.Distribution;
 import org.sonatype.aether.artifact.Artifact;
 import org.sonatype.aether.util.artifact.DefaultArtifact;
 
 /** A {@link Distribution} based on an Aether {@link Artifact} */
-public class ArtifactDistribution extends DefaultNameVersion implements
-               Distribution {
+public class ArtifactDistribution implements Distribution,
+               CategorizedNameVersion {
        private final Artifact artifact;
 
        public ArtifactDistribution(Artifact artifact) {
                this.artifact = artifact;
-               setName(artifact.getArtifactId());
-               setVersion(artifact.getVersion());
        }
 
        public ArtifactDistribution(String coords) {
@@ -30,6 +27,18 @@ public class ArtifactDistribution extends DefaultNameVersion implements
                return artifact;
        }
 
+       public String getName() {
+               return getArtifact().getArtifactId();
+       }
+
+       public String getVersion() {
+               return getArtifact().getVersion();
+       }
+
+       public String getCategory() {
+               return getArtifact().getGroupId();
+       }
+
        @Override
        public int hashCode() {
                return artifact.hashCode();
@@ -37,9 +46,12 @@ public class ArtifactDistribution extends DefaultNameVersion implements
 
        @Override
        public boolean equals(Object obj) {
-               if (obj instanceof NameVersion)
-                       return super.equals(obj);
-               else
+               if (obj instanceof CategorizedNameVersion) {
+                       CategorizedNameVersion cnv = (CategorizedNameVersion) obj;
+                       return getCategory().equals(cnv.getCategory())
+                                       && getName().equals(cnv.getName())
+                                       && getVersion().equals(cnv.getVersion());
+               } else
                        return artifact.equals(obj);
        }
 
index 8d1cee58d4859750b4cd51fb408d7d6b2cd189ba..438552e4b91189b192c624f06fe06145bef6126f 100644 (file)
@@ -2,9 +2,9 @@ package org.argeo.slc.repo.osgi;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -21,9 +21,11 @@ import org.apache.commons.io.IOUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.argeo.jcr.JcrUtils;
+import org.argeo.slc.ModuleSet;
 import org.argeo.slc.NameVersion;
 import org.argeo.slc.SlcException;
 import org.argeo.slc.aether.ArtifactIdComparator;
+import org.argeo.slc.build.Distribution;
 import org.argeo.slc.repo.OsgiFactory;
 import org.argeo.slc.repo.RepoUtils;
 import org.sonatype.aether.artifact.Artifact;
@@ -36,15 +38,14 @@ import org.springframework.util.PathMatcher;
  * the jars, or import them directly if they are already OSGi bundles and don't
  * need further modification.
  */
-public class ArchiveWrapper implements Runnable {
+public class ArchiveWrapper implements Runnable, ModuleSet, Distribution {
        private final static Log log = LogFactory.getLog(ArchiveWrapper.class);
 
        private OsgiFactory osgiFactory;
        private String version;
-       
+
        private String uri;
-       private List<String> fallbackUris = new ArrayList<String>();
-       
+
        // jars to wrap as OSGi bundles
        private Map<String, BndWrapper> wrappers = new HashMap<String, BndWrapper>();
 
@@ -67,6 +68,14 @@ public class ArchiveWrapper implements Runnable {
 
        }
 
+       public String getDistributionId() {
+               return uri;
+       }
+
+       public Iterator<? extends NameVersion> nameVersions() {
+               return wrappers.values().iterator();
+       }
+
        public void run() {
                if (mavenGroupIndexes && (version == null))
                        throw new SlcException(
index c81126e0d18202decd116af7ee4c3b3551bdc3ac..5c9ffccdeb9f29145d52af98e4254c5969abaeb9 100644 (file)
@@ -1,23 +1,25 @@
 package org.argeo.slc.repo.osgi;
 
-import java.util.HashSet;
-import java.util.Set;
-import java.util.TreeSet;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.DefaultNameVersion;
+import org.argeo.slc.ModuleSet;
 import org.argeo.slc.NameVersion;
 import org.argeo.slc.build.Distribution;
 import org.argeo.slc.build.ModularDistribution;
+import org.argeo.slc.execution.ExecutionFlow;
 import org.argeo.slc.repo.ArtifactDistribution;
 
+/** A consistent and versioned OSGi distribution, which can be built and tested. */
 public class ArgeoOsgiDistribution extends ArtifactDistribution implements
                ModularDistribution {
        private final static Log log = LogFactory
                        .getLog(ArgeoOsgiDistribution.class);
 
-       private Set<ArtifactDistribution> modules = new HashSet<ArtifactDistribution>();
+       private List<Object> modules = new ArrayList<Object>();
 
        public ArgeoOsgiDistribution(String coords) {
                super(coords);
@@ -25,29 +27,75 @@ public class ArgeoOsgiDistribution extends ArtifactDistribution implements
 
        public void init() {
                if (log.isDebugEnabled()) {
-                       log.debug("## " + toString());
-                       for (NameVersion nv : listModulesNameVersions()) {
-                               log.debug(nv);
+                       Iterator<? extends NameVersion> nvIt = nameVersions();
+                       while (nvIt.hasNext()) {
+                               log.debug(nvIt.next());
+
                        }
                }
        }
 
+       // private static void print(ModuleSet moduleSet, Integer depth) {
+       // StringBuilder prefix = new StringBuilder();
+       // for (int i = 0; i < depth; i++) {
+       // prefix.append(' ');
+       // }
+       // String p = prefix.toString();
+       // prefix.setLength(0);
+       // log.debug(p + "## " + moduleSet.toString());
+       // Iterator<? extends NameVersion> nvIt = moduleSet.nameVersions();
+       // while (nvIt.hasNext()) {
+       // NameVersion nv = nvIt.next();
+       // if (nv instanceof ModuleSet)
+       // print((ModuleSet) nv, depth + 1);
+       // else
+       // log.debug(p + nv);
+       //
+       // }
+       // }
+
        public void destroy() {
 
        }
 
        public Distribution getModuleDistribution(String moduleName,
                        String moduleVersion) {
-               NameVersion searched = new DefaultNameVersion(moduleName, moduleVersion);
-               for (ArtifactDistribution ad : modules) {
-                       if (ad.equals(searched))
-                               return ad;
-               }
+               // NameVersion searched = new DefaultNameVersion(moduleName,
+               // moduleVersion);
+               // for (Distribution ad : modules) {
+               // if (ad.equals(searched))
+               // return ad;
+               // }
                return null;
        }
 
-       public Set<NameVersion> listModulesNameVersions() {
-               return new TreeSet<NameVersion>(modules);
+       public Iterator<NameVersion> nameVersions() {
+               List<NameVersion> nameVersions = new ArrayList<NameVersion>();
+               for (Object module : modules) {
+                       // extract runnable from execution flow
+                       if (module instanceof ExecutionFlow)
+                               module = ((ExecutionFlow) module).getRunnable();
+
+                       if (module instanceof ModuleSet)
+                               addNameVersions(nameVersions, (ModuleSet) module);
+                       else if (module instanceof NameVersion) {
+                               NameVersion nv = (NameVersion) module;
+                               if (!nameVersions.contains(nv))
+                                       nameVersions.add(nv);
+                       } else
+                               log.warn("Ignored " + module);
+               }
+               return nameVersions.iterator();
+       }
+
+       private void addNameVersions(List<NameVersion> nameVersions,
+                       ModuleSet moduleSet) {
+               Iterator<? extends NameVersion> it = moduleSet.nameVersions();
+               while (it.hasNext()) {
+                       NameVersion nv = it.next();
+                       if (!nameVersions.contains(nv))
+                               nameVersions.add(nv);
+               }
        }
 
        public Object getModulesDescriptor(String descriptorType) {
@@ -55,7 +103,7 @@ public class ArgeoOsgiDistribution extends ArtifactDistribution implements
                return null;
        }
 
-       public void setModules(Set<ArtifactDistribution> modules) {
+       public void setModules(List<Object> modules) {
                this.modules = modules;
        }
 
index 00679e2c6247aae4130d33d56372836b0f06df17..564dd52d360d9349ea9ecde8050270e3ac15bd04 100644 (file)
@@ -1,18 +1,15 @@
 package org.argeo.slc.repo.osgi;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.Properties;
 import java.util.jar.Manifest;
 
-import org.apache.commons.io.IOUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.NameVersion;
+import org.argeo.slc.CategorizedNameVersion;
 import org.argeo.slc.SlcException;
+import org.argeo.slc.build.Distribution;
 import org.osgi.framework.Version;
 import org.sonatype.aether.artifact.Artifact;
 import org.sonatype.aether.util.artifact.DefaultArtifact;
@@ -23,7 +20,8 @@ import aQute.lib.osgi.Constants;
 import aQute.lib.osgi.Jar;
 
 /** Utilities around the BND library, which manipulates OSGi metadata. */
-public class BndWrapper implements Constants, NameVersion, BeanNameAware {
+public class BndWrapper implements Constants, CategorizedNameVersion,
+               Distribution, BeanNameAware {
        private final static Log log = LogFactory.getLog(BndWrapper.class);
 
        private String groupId;
@@ -112,38 +110,41 @@ public class BndWrapper implements Constants, NameVersion, BeanNameAware {
                return groupId;
        }
 
+       public String getCategory() {
+               return getGroupId();
+       }
+
        public void setGroupId(String groupId) {
                this.groupId = groupId;
        }
 
+       public String getDistributionId() {
+               return getArtifact().toString();
+       }
+
        public Artifact getArtifact() {
                return new DefaultArtifact(groupId, name, "jar", version);
        }
 
-       public static void main(String[] args) {
-               BndWrapper bndWrapper = new BndWrapper();
-               bndWrapper.setName("org.slf4j");
+       @Override
+       public String toString() {
+               return getArtifact().toString();
+       }
 
-               InputStream in = null;
-               InputStream propertiesIn = null;
-               OutputStream out = null;
-               Properties properties = new Properties();
-               File jarFile = new File(
-                               "/home/mbaudier/dev/work/130129-Distribution/slf4j/slf4j-1.7.5/slf4j-api-1.7.5.jar");
-               File propertiesFile = new File(
-                               "/home/mbaudier/dev/git/git.argeo.org/distribution/bnd/org.slf4j/bnd.bnd");
-               try {
-                       in = new FileInputStream(jarFile);
-                       // propertiesIn = new FileInputStream(propertiesFile);
-                       out = new FileOutputStream(new File("test.jar"));
-                       // properties.load(propertiesIn);
-                       bndWrapper.wrapJar(in, out);
-               } catch (Exception e) {
-                       throw new SlcException("Cannot test", e);
-               } finally {
-                       IOUtils.closeQuietly(in);
-                       IOUtils.closeQuietly(propertiesIn);
-                       IOUtils.closeQuietly(out);
-               }
+       @Override
+       public int hashCode() {
+               return getArtifact().hashCode();
        }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (obj instanceof CategorizedNameVersion) {
+                       CategorizedNameVersion cnv = (CategorizedNameVersion) obj;
+                       return getCategory().equals(cnv.getCategory())
+                                       && getName().equals(cnv.getName())
+                                       && getVersion().equals(cnv.getVersion());
+               } else
+                       return false;
+       }
+
 }
diff --git a/runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/CategorizedNameVersion.java b/runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/CategorizedNameVersion.java
new file mode 100644 (file)
index 0000000..fd7d56d
--- /dev/null
@@ -0,0 +1,10 @@
+package org.argeo.slc;
+
+/**
+ * Adds a dimension to {@link NameVersion} by adding an arbitrary category (e.g.
+ * Maven groupId, yum repository ID, etc.)
+ */
+public interface CategorizedNameVersion extends NameVersion {
+       /** The category of the component. */
+       public String getCategory();
+}
diff --git a/runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/ModuleSet.java b/runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/ModuleSet.java
new file mode 100644 (file)
index 0000000..fd125a2
--- /dev/null
@@ -0,0 +1,8 @@
+package org.argeo.slc;
+
+import java.util.Iterator;
+
+/** A set of {@link NameVersion}. */
+public interface ModuleSet {
+       Iterator<? extends NameVersion> nameVersions();
+}
index c63923babd5b58b69509fd91cbb5617638443f86..0b917aa49d8ba1ebb4b08deb9aa98c23d612a071 100644 (file)
@@ -15,8 +15,7 @@
  */
 package org.argeo.slc.build;
 
-import java.util.Set;
-
+import org.argeo.slc.ModuleSet;
 import org.argeo.slc.NameVersion;
 
 /**
@@ -25,12 +24,11 @@ import org.argeo.slc.NameVersion;
  * 
  * @see NameVersion
  */
-public interface ModularDistribution extends Distribution, NameVersion {
+public interface ModularDistribution extends Distribution, NameVersion,
+               ModuleSet {
        public Distribution getModuleDistribution(String moduleName,
                        String moduleVersion);
 
-       public Set<NameVersion> listModulesNameVersions();
-
        /** A descriptor such as P2, OBR or yum metadata. */
        public Object getModulesDescriptor(String descriptorType);
 }
index f347147b291f42656cdf367ef9df8168c7fa5258..520f249df50f11cd22b172d420262a0d18615195 100644 (file)
@@ -15,6 +15,8 @@
  */
 package org.argeo.slc.execution;
 
+import java.util.Iterator;
+
 /** Abstraction of an execution that can be identified and configured. */
 public interface ExecutionFlow extends Runnable {
        /** Retrieve an immutable parameter */
@@ -26,6 +28,18 @@ public interface ExecutionFlow extends Runnable {
        /** The specifications of the execution flow. */
        public ExecutionSpec getExecutionSpec();
 
+       /**
+        * List sub-runnables that would be executed if run() method would be
+        * called.
+        */
+       public Iterator<Runnable> runnables();
+
+       /**
+        * If there is one and only one runnable wrapped return it, throw an
+        * exeception otherwise.
+        */
+       public Runnable getRunnable();
+
        /**
         * The name of this execution flow. Can contains '/' which will be
         * interpreted by UIs as a hierarchy;
index 9035ef09c7f17e1aab99d24b015ede371cf9bb79..cb11615b6e5cb6add872fee7410333aa50213dcb 100644 (file)
@@ -15,7 +15,7 @@
  */
 package org.argeo.slc.osgi;
 
-import org.argeo.slc.BasicNameVersion;
+import org.argeo.slc.DefaultNameVersion;
 import org.argeo.slc.NameVersion;
 import org.argeo.slc.build.Distribution;
 import org.argeo.slc.core.build.ResourceDistribution;
@@ -29,9 +29,7 @@ import org.osgi.framework.Constants;
 import org.springframework.core.io.Resource;
 
 /** A deployed OSGi bundle. */
-public class OsgiBundle extends BasicNameVersion implements Module {
-       private static final long serialVersionUID = 35073826504550477L;
-
+public class OsgiBundle extends DefaultNameVersion implements Module {
        private ResourceDistribution distribution;
 
        private Long internalBundleId;
index aad574184aefd7d1390c7e1d7d7e4244190ff7d7..d40d9773483627cf03127023a4619d5577389839 100644 (file)
@@ -32,7 +32,7 @@ import javax.management.StandardMBean;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.BasicNameVersion;
+import org.argeo.slc.DefaultNameVersion;
 import org.argeo.slc.NameVersion;
 import org.argeo.slc.SlcException;
 import org.argeo.slc.core.execution.AbstractExecutionModulesManager;
@@ -155,7 +155,8 @@ public class OsgiExecutionModulesManager extends
                        String moduleName, String version) {
                ExecutionModuleDescriptor md = new ExecutionModuleDescriptor();
                OsgiBundle osgiBundle = null;
-               BasicNameVersion nameVersion = new BasicNameVersion(moduleName, version);
+               DefaultNameVersion nameVersion = new DefaultNameVersion(moduleName,
+                               version);
                bundles: for (Iterator<OsgiBundle> iterator = executionContexts
                                .keySet().iterator(); iterator.hasNext();) {
                        OsgiBundle ob = iterator.next();
index 3e0d14b925365edc327218a5712b880270600b73..2827c86d6f937fd7707b6e89618e9a24e94aa67d 100644 (file)
@@ -17,6 +17,7 @@ package org.argeo.slc.osgi.build;
 
 import java.util.ArrayList;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 import java.util.SortedMap;
@@ -24,7 +25,7 @@ import java.util.TreeMap;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.BasicNameVersion;
+import org.argeo.slc.DefaultNameVersion;
 import org.argeo.slc.NameVersion;
 import org.argeo.slc.SlcException;
 import org.argeo.slc.UnsupportedException;
@@ -52,21 +53,25 @@ public abstract class AbstractOsgiModularDistribution implements
 
        public Distribution getModuleDistribution(String moduleName,
                        String moduleVersion) {
-               return distributions
-                               .get(new BasicNameVersion(moduleName, moduleVersion));
+               return distributions.get(new DefaultNameVersion(moduleName,
+                               moduleVersion));
        }
 
        public String getDistributionId() {
                return bundleContext.getBundle().getSymbolicName()
                                + "-"
-                               + bundleContext.getBundle().getHeaders().get(
-                                               Constants.BUNDLE_VERSION);
+                               + bundleContext.getBundle().getHeaders()
+                                               .get(Constants.BUNDLE_VERSION);
        }
 
        public Set<NameVersion> listModulesNameVersions() {
                return distributions.keySet();
        }
 
+       public Iterator<NameVersion> nameVersions() {
+               return distributions.keySet().iterator();
+       }
+
        public void setBundleContext(BundleContext bundleContext) {
                this.bundleContext = bundleContext;
        }
@@ -152,13 +157,13 @@ public abstract class AbstractOsgiModularDistribution implements
        }
 
        public String getVersion() {
-               return bundleContext.getBundle().getHeaders().get(
-                               Constants.BUNDLE_VERSION).toString();
+               return bundleContext.getBundle().getHeaders()
+                               .get(Constants.BUNDLE_VERSION).toString();
        }
 
        @Override
        public String toString() {
-               return new BasicNameVersion(this).toString();
+               return new DefaultNameVersion(this).toString();
        }
 
        public void setEclipseUpdateSite(EclipseUpdateSite eclipseUpdateSite) {
index 78f566ccb89bbd1cfd222931180619b92bb9b030..51595750eec5afaa051e6eab5f62eac6d45c80d6 100644 (file)
@@ -23,7 +23,7 @@ import java.util.jar.JarInputStream;
 import java.util.jar.Manifest;
 
 import org.apache.commons.io.IOUtils;
-import org.argeo.slc.BasicNameVersion;
+import org.argeo.slc.DefaultNameVersion;
 import org.argeo.slc.NameVersion;
 import org.argeo.slc.build.Distribution;
 import org.argeo.slc.core.build.VersionedResourceDistribution;
@@ -59,7 +59,7 @@ public class BundleModularDistribution extends AbstractOsgiModularDistribution
 
                                String version = mf.getMainAttributes().getValue(
                                                Constants.BUNDLE_VERSION);
-                               BasicNameVersion nameVersion = new BasicNameVersion(name,
+                               DefaultNameVersion nameVersion = new DefaultNameVersion(name,
                                                version);
                                distributions.put(nameVersion,
                                                new VersionedResourceDistribution(name, version,