X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=inline;f=runtime%2Forg.argeo.slc.support.osgi%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fosgi%2Fbuild%2FAbstractOsgiModularDistribution.java;h=2827c86d6f937fd7707b6e89618e9a24e94aa67d;hb=7d6251e4260ed330236ae86b732307439affcf76;hp=65ad39f256e39475da4fceaed131f7526532bd10;hpb=1fdb1b4e7b1d2b0cabb6483238301b857a6392fa;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/build/AbstractOsgiModularDistribution.java b/runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/build/AbstractOsgiModularDistribution.java index 65ad39f25..2827c86d6 100644 --- a/runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/build/AbstractOsgiModularDistribution.java +++ b/runtime/org.argeo.slc.support.osgi/src/main/java/org/argeo/slc/osgi/build/AbstractOsgiModularDistribution.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010 Mathieu Baudier + * Copyright (C) 2007-2012 Argeo GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -13,11 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - 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; @@ -25,12 +25,12 @@ import java.util.TreeMap; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.argeo.slc.DefaultNameVersion; +import org.argeo.slc.NameVersion; import org.argeo.slc.SlcException; import org.argeo.slc.UnsupportedException; -import org.argeo.slc.build.BasicNameVersion; import org.argeo.slc.build.Distribution; import org.argeo.slc.build.ModularDistribution; -import org.argeo.slc.build.NameVersion; import org.osgi.framework.BundleContext; import org.osgi.framework.Constants; import org.springframework.beans.factory.InitializingBean; @@ -53,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 listModulesNameVersions() { return distributions.keySet(); } + public Iterator nameVersions() { + return distributions.keySet().iterator(); + } + public void setBundleContext(BundleContext bundleContext) { this.bundleContext = bundleContext; } @@ -153,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) {