diff --git a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/.classpath b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/.classpath index 074455e8903915bac134d8c27190d9dd2bc059dd..5ccc0351b3a817cf20187cedec7c18b480cb4fb0 100644 --- a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/.classpath +++ b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/.classpath @@ -7,7 +7,11 @@ </attributes> </classpathentry> <classpathentry exported="true" kind="lib" path="lib/aether.jar"/> - <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"> + <accessrules> + <accessrule kind="accessible" pattern="org.eclipse.debug.internal.ui.DebugUIPlugin"/> + </accessrules> + </classpathentry> <classpathentry kind="src" output="target/test-classes" path="src/test/java"> <attributes> <attribute name="optional" value="true"/> diff --git a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/build.properties b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/build.properties index bc8f0e2b28f64f322eed6361c258ab26a6f9bcfe..0a57567118d35733b5ae7e5871107235a5bd034c 100644 --- a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/build.properties +++ b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/build.properties @@ -5,7 +5,8 @@ bin.includes = META-INF/,\ fragment.xml,\ images/,\ lib/,\ - lib/aether.jar + lib/aether.jar,\ + icons/ jars.compile.order = .,\ lib/aether.jar diff --git a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/handlers/NewRunConfigHandler.java b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/handlers/NewRunConfigHandler.java index 582f33ff03aebf24a3e980b090d9b234193d1f06..495c6ee6970262453f0490399dfdf406e4d9c838 100644 --- a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/handlers/NewRunConfigHandler.java +++ b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/handlers/NewRunConfigHandler.java @@ -19,17 +19,11 @@ */ package org.universaal.uaalpax.handlers; -import java.io.PrintWriter; -import java.io.StringWriter; import java.util.ArrayList; -import java.util.List; - import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.Status; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.ILaunchConfigurationType; @@ -37,10 +31,7 @@ import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchManager; import org.eclipse.debug.internal.ui.DebugUIPlugin; import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.ILaunchGroup; import org.eclipse.jface.dialogs.ErrorDialog; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.window.Window; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.handlers.HandlerUtil; diff --git a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/BundleEntry.java b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/BundleEntry.java index 2afe42925b12217ff43b9df9ef9926b37c4a843d..1d4aaa8ab15a116e20be5ffc05ad3011876e1177 100644 --- a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/BundleEntry.java +++ b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/BundleEntry.java @@ -24,49 +24,51 @@ import org.sonatype.aether.artifact.Artifact; import org.sonatype.aether.util.artifact.DefaultArtifact; public class BundleEntry { - private String url; + private final LaunchURL launchUrl; private boolean selected; private boolean start; private int level; private boolean update; - private String projectName; + private final String projectName; public static final String PROP_PROJECT = "Project"; public static final String PROP_LEVEL = "Level"; - public static String urlFromArtifact(Artifact a) { - return "mvn:" + a.getGroupId() + "/" + a.getArtifactId() + "/" + a.getVersion(); + public static LaunchURL launchUrlFromArtifact(Artifact a) { + // TODO: check for wrap + return new LaunchURL("mvn:" + a.getGroupId() + "/" + a.getArtifactId() + "/" + a.getBaseVersion()); } - public static Artifact artifactFromURL(String url) { - if (url.startsWith("mvn:") || url.startsWith("scan-bundle:mvn:")) { - String[] s = url.substring(url.indexOf("mvn:") + 4).split("/"); + public static ArtifactURL artifactUrlFromArtifact(Artifact a) { + return new ArtifactURL(a.getGroupId() + "/" + a.getArtifactId() + "/" + a.getBaseVersion()); + } + + public static Artifact artifactFromURL(LaunchURL url) { + int mvn = url.url.indexOf("mvn:"); + if (mvn >= 0) { + String[] s = url.url.substring(mvn + 4).split("/"); - if (s.length == 3) - return new DefaultArtifact(s[0], s[1], null, s[2]); - else if (s.length == 2) - return new DefaultArtifact(s[0], s[1], null, null); - else - return null; - } else if (url.startsWith("scan-composite:mvn:")) { - String[] s = url.substring(19).split("/"); + String ext = "jar"; + if (url.url.contains("scan-composite:")) + ext = "composite"; - if (s.length == 3) - return new DefaultArtifact(s[0], s[1], "composite", s[2]); + if (s.length == 2) + return new DefaultArtifact(s[0], s[1], ext, null); + else if (s.length == 3) + return new DefaultArtifact(s[0], s[1], ext, s[2]); else if (s.length == 4) return new DefaultArtifact(s[0], s[1], s[3], s[2]); - else - return null; - } else - return null; + } + + return null; } - public static boolean isCompositeURL(String url) { - return url.startsWith("mvn:") || url.startsWith("scan-bundle:mvn:"); + public static boolean isCompositeURL(LaunchURL url) { + return url.url.contains("scan-composite:"); } - public BundleEntry(String url, String projectName, int startLevel, boolean update) { - this.url = url; + public BundleEntry(LaunchURL url, String projectName, int startLevel, boolean update) { + this.launchUrl = url; this.selected = true; this.start = true; this.level = startLevel; @@ -74,8 +76,8 @@ public class BundleEntry { this.projectName = projectName; } - public BundleEntry(String url, boolean selected, boolean start, int startLevel, boolean update) { - this.url = url; + public BundleEntry(LaunchURL url, boolean selected, boolean start, int startLevel, boolean update) { + this.launchUrl = url; this.selected = selected; this.start = start; this.level = startLevel; @@ -83,44 +85,74 @@ public class BundleEntry { this.projectName = null; } - public BundleEntry(String url, String settingsStr) { - this.url = url; + public BundleEntry(LaunchURL url, String settingsStr) { + this.launchUrl = url; String[] settings = settingsStr.split("@"); - this.level = -1; - + int level = -1; + boolean update = true; + boolean start = true; + boolean selected = true; if (settings.length == 4) { try { - this.selected = Boolean.parseBoolean(settings[0]); - this.start = Boolean.parseBoolean(settings[1]); + selected = Boolean.parseBoolean(settings[0]); + start = Boolean.parseBoolean(settings[1]); try { - this.level = Integer.parseInt(settings[2]); + level = Integer.parseInt(settings[2]); } catch (NumberFormatException e) { level = -1; } - this.update = Boolean.parseBoolean(settings[3]); + update = Boolean.parseBoolean(settings[3]); } catch (NumberFormatException e) { } } - + this.level = level; + this.update = update; + this.start = start; + this.selected = selected; this.projectName = null; } public BundleEntry(Artifact a) { - this.url = urlFromArtifact(a); + this.launchUrl = launchUrlFromArtifact(a); this.selected = true; this.start = true; this.level = 1; // TODO this.update = true; // TODO - this.projectName = this.url; + this.projectName = this.launchUrl.url; + } + + public BundleEntry(Artifact a, int level) { + this.launchUrl = launchUrlFromArtifact(a); + this.selected = true; + this.start = true; + this.level = level; + this.update = true; // TODO + this.projectName = this.launchUrl.url; + } + + public void setSelected(boolean selected) { + this.selected = selected; + } + + public void setStart(boolean start) { + this.start = start; + } + + public void setLevel(int level) { + this.level = level; + } + + public void setUpdate(boolean update) { + this.update = update; } public boolean isComposite() { - return isCompositeURL(getURL()); + return isCompositeURL(getLaunchUrl()); } public Artifact toArtifact() { - return artifactFromURL(getURL()); + return artifactFromURL(getLaunchUrl()); } public String getOptions() { @@ -128,64 +160,68 @@ public class BundleEntry { + String.valueOf(update); } - public BundleEntry(String projectName, String url, String settingsStr) { - this(url, settingsStr); + public BundleEntry(String projectName, LaunchURL url, String settingsStr) { + this.launchUrl = url; + + String[] settings = settingsStr.split("@"); + int level = -1; + boolean update = true; + boolean start = true; + boolean selected = true; + if (settings.length == 4) { + try { + selected = Boolean.parseBoolean(settings[0]); + start = Boolean.parseBoolean(settings[1]); + try { + level = Integer.parseInt(settings[2]); + } catch (NumberFormatException e) { + level = -1; + } + update = Boolean.parseBoolean(settings[3]); + } catch (NumberFormatException e) { + } + } + this.level = level; + this.update = update; + this.start = start; + this.selected = selected; this.projectName = projectName; } + public ArtifactURL getArtifactUrl() { + // TODO + return artifactUrlFromArtifact(toArtifact()); + } + public String getProjectName() { if (projectName != null) return projectName; else - return url; - } - - public void setProjectName(String projectName) { - this.projectName = projectName; - } - - public String getURL() { - return url; + return launchUrl.url; } - public void setUrl(String url) { - this.url = url; + public LaunchURL getLaunchUrl() { + return launchUrl; } public boolean isSelected() { return selected; } - public void setSelected(boolean selected) { - this.selected = selected; - } - public boolean isStart() { return start; } - public void setStart(boolean start) { - this.start = start; - } - public int getLevel() { return level; } - public void setLevel(int startLevel) { - this.level = startLevel; - } - public boolean isUpdate() { return update; } - public void setUpdate(boolean update) { - this.update = update; - } - public boolean equalsURL(BundleEntry other) { - return getURL().equals(other.getURL()); + return getLaunchUrl().equals(other.getLaunchUrl()); } @Override @@ -197,7 +233,7 @@ public class BundleEntry { // TODO really equals only if _all settings_ matches??? BundleEntry pu = (BundleEntry) obj; - return this.getLevel() == pu.getLevel() && this.getURL().equals(pu.getURL()) && this.isSelected() == pu.isSelected() + return this.getLevel() == pu.getLevel() && this.getLaunchUrl().equals(pu.getLaunchUrl()) && this.isSelected() == pu.isSelected() && this.isStart() == pu.isStart() && this.isUpdate() == pu.isUpdate(); } @@ -206,7 +242,7 @@ public class BundleEntry { int hashcode = 1; hashcode *= 13 * getLevel(); hashcode *= 7 * getProjectName().hashCode(); - hashcode *= 23 * getURL().hashCode(); + hashcode *= 23 * getLaunchUrl().hashCode(); hashcode *= 17 * (isSelected() ? 1 : 3); hashcode *= 11 * (isUpdate() ? 1 : 3); hashcode *= 19 * (isStart() ? 1 : 3); @@ -215,6 +251,6 @@ public class BundleEntry { @Override public String toString() { - return "ProjectURL: " + getProjectName() + " | " + isStart() + " | " + getLevel() + " | " + isUpdate(); + return "[BundleEntry: " + getProjectName() + " | " + isStart() + " | " + getLevel() + " | " + isUpdate() + "]"; } } diff --git a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/BundleModel.java b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/BundleModel.java index e85a135f56fb8f19d1f4f09726635d0ccd1842a5..5f7d38baadadefc25c397ce7a52a0129353baf6f 100644 --- a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/BundleModel.java +++ b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/BundleModel.java @@ -20,6 +20,7 @@ package org.universaal.uaalpax.model; +import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -29,11 +30,19 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.CancellationException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; import java.util.concurrent.TimeoutException; import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.operation.IRunnableWithProgress; import org.sonatype.aether.artifact.Artifact; import org.sonatype.aether.collection.DependencyCollectionException; import org.sonatype.aether.graph.Dependency; @@ -42,8 +51,6 @@ import org.sonatype.aether.util.artifact.DefaultArtifact; import org.universaal.uaalpax.shared.Attribute; import org.universaal.uaalpax.shared.MavenDependencyResolver; -import aether.demo.util.ConsoleDependencyGraphDumper; - public class BundleModel { /** Threshold for assuming that a particular version is used */ private static final float VERSION_WEIGHT_THRESHOLD = 0.3f; @@ -63,11 +70,20 @@ public class BundleModel { private List<BundleChangeListener> changeListeners = new ArrayList<BundleChangeListener>(); + private ArtifactGraph artifactGraph; + + private ExecutorService graphExecutor; + private Future<?> graphRebuildFuture; + public BundleModel(MavenDependencyResolver depResolver, UAALVersionProvider versionProvider, ModelDialogProvider dialogProvider) { - currentBundles = new BundleSet(); + this.currentBundles = new BundleSet(); this.dependencyResolver = depResolver; this.versionProvider = versionProvider; this.dialogProvider = dialogProvider; + + this.artifactGraph = new ArtifactGraph(depResolver); + this.graphExecutor = Executors.newSingleThreadExecutor(); + this.graphRebuildFuture = null; } public void addChangeListener(BundleChangeListener listener) { @@ -87,49 +103,99 @@ public class BundleModel { } public void updateModel(ILaunchConfiguration configuration) { + cancelRebuildGraph(); + currentBundles.updateBundles(configuration); currentVersion = UNKNOWN_VERSION; for (String version : versionProvider.getAvailableVersions()) { - if (containsAllBundles(currentBundles, version)) { + if (containsAllBundlesOfVersion(currentBundles, version)) { currentVersion = version; break; } } + rebuildGraphInBackground(); + updatePresenters(); } - public void removeAll(Collection<BundleEntry> entries) { - /* - * for (BundleEntry be : entries) { if (!currentBundles.containsURL(be.getURL())) continue; // nothing to do - * - * removeUnneededDependencies(be); currentBundles.remove(be); } - */ + private void rebuildGraphInBackground() { + cancelRebuildGraph(); + + graphRebuildFuture = graphExecutor.submit(new Runnable() { + public void run() { + System.out.println("rebuilding graph..."); + artifactGraph.rebuildFromSetInBackground(currentBundles); + System.out.println("rebuilding graph finished"); + } + }); + } + + private void cancelRebuildGraph() { + if (graphRebuildFuture != null) { + graphRebuildFuture.cancel(true); + graphRebuildFuture = null; + } + } + + private void waitGraph() { + if (graphRebuildFuture != null) { + if (!graphRebuildFuture.isDone()) { + ProgressMonitorDialog d = new ProgressMonitorDialog(dialogProvider.getShell()); + try { + d.run(false, false, new IRunnableWithProgress() { + + public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { + monitor.beginTask("Dependency graph", IProgressMonitor.UNKNOWN); + monitor.subTask("Building dependency graph of launch config bundles..."); + + try { + graphRebuildFuture.get(); + } catch (InterruptedException e) { + } catch (ExecutionException e) { + } catch (CancellationException e) { + } + + monitor.done(); + } + }); + } catch (InvocationTargetException e1) { + } catch (InterruptedException e1) { + } + } + } + + graphRebuildFuture = null; + } + + public void removeAll(Set<BundleEntry> entries) { + waitGraph(); removeUnneededDependencies(entries); + updatePresenters(); } public void remove(BundleEntry be) { + waitGraph(); removeNoUpdate(be); updatePresenters(); } public void removeNoUpdate(BundleEntry be) { - if (!currentBundles.containsURL(be.getURL())) - return; // nothing to do - + waitGraph(); Set<BundleEntry> bes = new HashSet<BundleEntry>(); bes.add(be); removeUnneededDependencies(bes); - currentBundles.remove(be); } public void add(BundleEntry e) { + waitGraph(); insertBundleAndDeps(e); updatePresenters(); } public void addAll(Collection<BundleEntry> entries) { + waitGraph(); for (BundleEntry be : entries) insertBundleAndDeps(be); updatePresenters(); @@ -140,18 +206,19 @@ public class BundleModel { } private void insertBundleAndDeps(BundleEntry be) { + waitGraph(); + while (true) { - Artifact a = be.toArtifact(); boolean insterted = false; if (a != null) { try { - DependencyNode deps = dependencyResolver.resolve(a); - ConsoleDependencyGraphDumper dumper = new ConsoleDependencyGraphDumper(); - deps.accept(dumper); + DependencyNode deps = dependencyResolver.resolveDependencies(a); + // ConsoleDependencyGraphDumper dumper = new ConsoleDependencyGraphDumper(); + // deps.accept(dumper); - Set<String> depList = listDependencies(deps, null); + Set<ArtifactURL> depList = listDependencies(deps, null); String approxVersion = checkVersion(depList); if (approxVersion != null) { @@ -169,7 +236,7 @@ public class BundleModel { } // version is set and differs from approximated one else if (!getCurrentVersion().equals(approxVersion)) { - int sel = dialogProvider.openDialog("Version conflict", "The bundle \"" + be.getURL() + int sel = dialogProvider.openDialog("Version conflict", "The bundle \"" + be.getLaunchUrl() + "\" which you want to add depends on " + "uAAL version " + approxVersion + ", but the current run config version is " + getCurrentVersion() + ". Do you really want to add this bundle with its all depencencies?", new String[] { "No", "Yes", @@ -184,9 +251,9 @@ public class BundleModel { } } - insertDependencies(deps /* , 1 */); // deps contains already be - // as root, so no need to - // insert it second time + insertDependencies(deps /* , 1 */); // deps contains already 'be' as root, so no need to insert it second time + + artifactGraph.insertDependencyNode(deps, null); // update graph insterted = true; } catch (DependencyCollectionException e1) { // TODO Auto-generated catch block @@ -198,7 +265,7 @@ public class BundleModel { if (!insterted) { int ret = dialogProvider.openDialog("Error during depencency resolution", - "There was an error resolvin depencencies for bundle " + be.getURL() + ". ", "Ignore", "Retry", "Cancel"); + "There was an error resolvin depencencies for bundle " + be.getLaunchUrl() + ". ", "Ignore", "Retry", "Cancel"); if (ret == 0) // ignore currentBundles.add(be); @@ -211,13 +278,13 @@ public class BundleModel { } } - private Set<String> listDependencies(DependencyNode node, Set<String> deps) { + private Set<ArtifactURL> listDependencies(DependencyNode node, Set<ArtifactURL> deps) { if (deps == null) - deps = new HashSet<String>(); + deps = new HashSet<ArtifactURL>(); Dependency d = node.getDependency(); if (d != null) - deps.add(BundleEntry.urlFromArtifact(d.getArtifact())); + deps.add(BundleEntry.artifactUrlFromArtifact(d.getArtifact())); for (DependencyNode child : node.getChildren()) listDependencies(child, deps); @@ -239,9 +306,11 @@ public class BundleModel { private Artifact checkCoreToOsgi(Artifact a) { if (a.getArtifactId().endsWith(".core")) { - - Artifact osgi = new DefaultArtifact(a.getGroupId(), a.getArtifactId(), a.getExtension(), a.getVersion()); + // System.out.println("renaming artifact from " + a); + Artifact osgi = new DefaultArtifact(a.getGroupId(), a.getArtifactId().substring(0, a.getArtifactId().length() - 5) + .concat(".osgi"), a.getExtension(), a.getBaseVersion()); osgi = dependencyResolver.resolveArtifact(osgi); + // System.out.println("to " + osgi); if (osgi != null) return osgi; } @@ -265,99 +334,129 @@ public class BundleModel { if (d != null) { Artifact a = d.getArtifact(); a = checkCoreToOsgi(a); - String url = BundleEntry.urlFromArtifact(a); + ArtifactURL url = BundleEntry.artifactUrlFromArtifact(a); - // check if bundle is already included + // check if bundle is already included BundleEntry be = currentBundles.find(url); if (be != null) { minStartLevel = Math.max(minStartLevel, be.getLevel()); } else { minStartLevel++; - be = new BundleEntry(a); - if (versionProvider.isIgnoreBundleOfVersion(be, currentVersion)) + + ArtifactURL aurl = BundleEntry.artifactUrlFromArtifact(a); + if (versionProvider.isIgnoreArtifactOfVersion(currentVersion, aurl)) return minStartLevel; - be.setLevel(minStartLevel); - currentBundles.add(be); + currentBundles.add(new BundleEntry(a, minStartLevel)); } } return minStartLevel; } - private void removeUnneededDependencies(Collection<BundleEntry> bes) { - Set<Artifact> arts = new HashSet<Artifact>(); - for (BundleEntry be : bes) { - Artifact beArt = be.toArtifact(); - if (beArt != null) - arts.add(beArt); - } + private void removeUnneededDependencies(Set<BundleEntry> entries) { + // ArtifactNode aNode = artifactGraph.getNode(be.getStringUrl()); + // if (aNode == null) + // return; // TODO ok??? + // + // Set<String> urls = artifactGraph.removeArtifact(be, versionProvider.getBundlesOfVersion(currentVersion)); + // + // Set<Artifact> arts = new HashSet<Artifact>(); + // for (BundleEntry be : bes) { + // Artifact beArt = be.toArtifact(); + // if (beArt != null) + // arts.add(beArt); + // } - try { - // find out all dependencies of be (-> beDeps) - Set<String> beDeps = listDependencies(dependencyResolver.resolve(arts), null); - - BundleSet mwBundles = getMiddlewareBundles(); - if (mwBundles == null) - mwBundles = new BundleSet(); + while (true) { + Set<ArtifactURL> willBeRemoved = artifactGraph.checkCanRemove(entries); - // find out dependencies of all bundles in model except those of - // in beDeps but not in current version bundles (-> otherDeps) - Set<Artifact> otherArts = new HashSet<Artifact>(); - for (BundleEntry oe : currentBundles) { - // !mwBundles.containsURL is to add mw bundles to otherDeps set, - // even if the seem only be needed for be - if (beDeps.contains(oe.getURL()) && !mwBundles.containsURL(oe.getURL())) - continue; + if (willBeRemoved != null && !willBeRemoved.isEmpty()) { + BundleSet toRemove = new BundleSet(); + + StringBuilder sb = new StringBuilder("Following bundles depend on the bundles to remove:\n\n"); + + for (BundleEntry be : currentBundles) { + if (willBeRemoved.contains(be.getArtifactUrl())) { + toRemove.add(be); + sb.append(be.getLaunchUrl()).append("\n"); + } + } + + sb.append("\nHow to proceed?"); + + int ret = dialogProvider.openDialog("Error while removing the bundles", sb.toString(), "Remove them all", "Cancel"); - Artifact a = oe.toArtifact(); - if (a != null) - otherArts.add(a); + if (ret == 0) { // remove all + entries = new HashSet<BundleEntry>(entries); + for (BundleEntry be : toRemove) + entries.add(be); + + continue; + } + } else { + Set<ArtifactURL> removed = artifactGraph.removeArtifacts(entries, versionProvider.getBundlesOfVersion(currentVersion)); + for (Iterator<BundleEntry> iter = currentBundles.iterator(); iter.hasNext();) { + BundleEntry be = iter.next(); + if (removed.contains(be.getArtifactUrl()) || entries.contains(be)) + iter.remove(); + } } - Set<String> otherDeps = listDependencies(dependencyResolver.resolve(otherArts), null); - - // find out which bundles in model are only dependencies of be, - // but not of any other bundle (-> unneededBundles as url set) - Set<String> unneededBundles = new HashSet<String>(); - for (String d : beDeps) - if (!otherDeps.contains(d)) - unneededBundles.add(d); - - // remove unneeded bundles from model - for (String url : unneededBundles) - currentBundles.removeURL(url); - } catch (DependencyCollectionException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } catch (TimeoutException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + break; } } - /* - * private void removeUnneededDependencies(BundleEntry be) { Artifact beArt = be.toArtifact(); if (beArt != null) { try { // find out - * all dependencies of be (-> beDeps) Set<String> beDeps = listDependencies(dependencyResolver.resolve(beArt), null); - * - * BundleSet mwBundles = getMiddlewareBundles(); if (mwBundles == null) mwBundles = new BundleSet(); - * - * // find out dependencies of all bundles in model except those of // in beDeps but not in current version bundles (-> otherDeps) - * Set<Artifact> otherArts = new HashSet<Artifact>(); for (BundleEntry oe : currentBundles) { // !mwBundles.containsURL is to add mw - * bundles to otherDeps set, // even if the seem only be needed for be if (beDeps.contains(oe.getURL()) && - * !mwBundles.containsURL(oe.getURL())) continue; - * - * Artifact a = oe.toArtifact(); if (a != null) otherArts.add(a); } - * - * Set<String> otherDeps = listDependencies(dependencyResolver.resolve(otherArts), null); - * - * // find out which bundles in model are only dependencies of be, // but not of any other bundle (-> unneededBundles as url set) - * Set<String> unneededBundles = new HashSet<String>(); for (String d : beDeps) if (!otherDeps.contains(d)) unneededBundles.add(d); - * - * // remove unneeded bundles from model for (String url : unneededBundles) currentBundles.removeURL(url); } catch - * (DependencyCollectionException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } catch (TimeoutException e) { // TODO - * Auto-generated catch block e.printStackTrace(); } } } - */ + // private void removeUnneededDependencies(Collection<BundleEntry> bes) { + // Set<Artifact> arts = new HashSet<Artifact>(); + // for (BundleEntry be : bes) { + // Artifact beArt = be.toArtifact(); + // if (beArt != null) + // arts.add(beArt); + // } + // + // try { + // // find out all dependencies of be (-> beDeps) + // Set<String> beDeps = listDependencies(dependencyResolver.resolve(arts), null); + // + // BundleSet mwBundles = getMiddlewareBundles(); + // if (mwBundles == null) + // mwBundles = new BundleSet(); + // + // // find out dependencies of all bundles in model except those of + // // in beDeps but not in current version bundles (-> otherDeps) + // Set<Artifact> otherArts = new HashSet<Artifact>(); + // for (BundleEntry oe : currentBundles) { + // // !mwBundles.containsURL is to add mw bundles to otherDeps set, + // // even if the seem only be needed for be + // if (beDeps.contains(oe.getLaunchUrl()) && !mwBundles.containsURL(oe.getLaunchUrl())) + // continue; + // + // Artifact a = oe.toArtifact(); + // if (a != null) + // otherArts.add(a); + // } + // + // Set<String> otherDeps = listDependencies(dependencyResolver.resolve(otherArts), null); + // + // // find out which bundles in model are only dependencies of be, + // // but not of any other bundle (-> unneededBundles as url set) + // Set<String> unneededBundles = new HashSet<String>(); + // for (String d : beDeps) + // if (!otherDeps.contains(d)) + // unneededBundles.add(d); + // + // // remove unneeded bundles from model + // for (String url : unneededBundles) + // currentBundles.removeURL(url); + // } catch (DependencyCollectionException e1) { + // // TODO Auto-generated catch block + // e1.printStackTrace(); + // } catch (TimeoutException e) { + // // TODO Auto-generated catch block + // e.printStackTrace(); + // } + // } public void updatePresenters() { BundleSet projects = currentBundles; @@ -365,12 +464,12 @@ public class BundleModel { projects = presenter.updateProjectList(projects); } - private boolean containsAllBundles(BundleSet launchProjects, String version) { - BundleSet bundles = versionProvider.getBundlesOfVersion(version); - if (bundles == null) + private boolean containsAllBundlesOfVersion(BundleSet launchProjects, String version) { + BundleSet versionBundles = versionProvider.getBundlesOfVersion(version); + if (versionBundles == null) return false; - for (String url : bundles.allURLs()) + for (ArtifactURL url : versionBundles.allURLs()) if (!launchProjects.containsURL(url)) return false; @@ -378,6 +477,8 @@ public class BundleModel { } public void changeToVersion(String newVersion) { + waitGraph(); + BundleSet oldBS = versionProvider.getBundlesOfVersion(currentVersion); if (oldBS != null) for (BundleEntry be : oldBS) @@ -385,7 +486,7 @@ public class BundleModel { for (Iterator<BundleEntry> iter = currentBundles.iterator(); iter.hasNext();) { BundleEntry be = iter.next(); - if (versionProvider.isIgnoreBundleOfVersion(be, newVersion)) + if (versionProvider.isIgnoreArtifactOfVersion(newVersion, be.getArtifactUrl())) iter.remove(); } @@ -397,15 +498,14 @@ public class BundleModel { currentVersion = newVersion; + rebuildGraphInBackground(); notifyChanged(); updatePresenters(); } - public boolean checkCompatibleWithVersion(String url, String version) { + public boolean checkCompatibleWithVersion(String version, ArtifactURL url) { BundleSet bundles = versionProvider.getBundlesOfVersion(version); - if (bundles == null || bundles.containsURL(url)) // url is in bundles - // for current - // version + if (bundles == null || bundles.containsURL(url)) // url is in bundles for current version return true; for (String v : versionProvider.getAvailableVersions()) { @@ -421,29 +521,29 @@ public class BundleModel { return true; } - public Set<String> getIncompatibleProjects(String newVersion) { + public Set<ArtifactURL> getIncompatibleProjects(String newVersion) { // find out which projects have to be checked for compatibility - Set<String> toCheck = new HashSet<String>(); + Set<ArtifactURL> toCheck = new HashSet<ArtifactURL>(); BundleSet versionBundles = versionProvider.getBundlesOfVersion(currentVersion); // fill toCheck with all bundles except of those in current version set if (versionBundles != null) { - for (String url : currentBundles.allURLs()) + for (ArtifactURL url : currentBundles.allURLs()) if (!versionBundles.containsURL(url)) toCheck.add(url); } else - for (String url : currentBundles.allURLs()) + for (ArtifactURL url : currentBundles.allURLs()) toCheck.add(url); // check all toCheck project for compatibility with new version - for (Iterator<String> iter = toCheck.iterator(); iter.hasNext();) - if (checkCompatibleWithVersion(iter.next(), newVersion)) + for (Iterator<ArtifactURL> iter = toCheck.iterator(); iter.hasNext();) + if (checkCompatibleWithVersion(newVersion, iter.next())) iter.remove(); return toCheck; } - public boolean checkCompatibleWithCurrentVersion(String url) { - return checkCompatibleWithVersion(url, currentVersion); + public boolean checkCompatibleWithCurrentVersion(ArtifactURL url) { + return checkCompatibleWithVersion(currentVersion, url); } public void performApply(final ILaunchConfigurationWorkingCopy configuration) { @@ -460,10 +560,10 @@ public class BundleModel { for (BundleEntry be : currentBundles) { StringBuffer options = new StringBuffer().append(be.isSelected()).append("@").append(be.isStart()).append("@") .append(be.getLevel()).append("@").append(be.isUpdate()); - toSave.put(be.getURL(), options.toString()); + toSave.put(be.getLaunchUrl().url, options.toString()); if (be.isSelected()) { - final StringBuffer provisionFrom = new StringBuffer(be.getURL()); + final StringBuffer provisionFrom = new StringBuffer(be.getLaunchUrl().url); if (be.getLevel() >= 0) { provisionFrom.append("@").append(be.getLevel()); } @@ -558,7 +658,7 @@ public class BundleModel { configuration.setAttribute(attribute, value); } - private String checkVersion(Set<String> deps) { + private String checkVersion(Set<ArtifactURL> deps) { String maxVersion = null; float maxWeight = 0; diff --git a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/BundleSet.java b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/BundleSet.java index ac4362d9671196dbc917283208df9fba9facd34c..e2296f2737c6e0050a58aac1a8307c133cbcf88f 100644 --- a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/BundleSet.java +++ b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/BundleSet.java @@ -31,14 +31,14 @@ import org.eclipse.debug.core.ILaunchConfiguration; import org.universaal.uaalpax.shared.Attribute; public class BundleSet implements Iterable<BundleEntry> { - private Map<String, String> bundles; + private Map<ArtifactURL, BundleEntry> bundles; public BundleSet() { - bundles = new HashMap<String, String>(); + bundles = new HashMap<ArtifactURL, BundleEntry>(); } - public BundleSet(Map<String, String> bundles) { - this.bundles = new HashMap<String, String>(bundles); + public BundleSet(Map<ArtifactURL, BundleEntry> bundles) { + this.bundles = new HashMap<ArtifactURL, BundleEntry>(bundles); } public BundleSet(ILaunchConfiguration configuration) { @@ -46,100 +46,74 @@ public class BundleSet implements Iterable<BundleEntry> { } public BundleSet(BundleSet bundleset) { - this.bundles = new HashMap<String, String>(bundleset.bundles); + this.bundles = new HashMap<ArtifactURL, BundleEntry>(bundleset.bundles); } - + public Iterator<BundleEntry> iterator() { - return new BundleIterator(bundles.entrySet().iterator()); + return bundles.values().iterator(); } public void updateBundles(ILaunchConfiguration configuration) { + bundles = new HashMap<ArtifactURL, BundleEntry>(); try { @SuppressWarnings("unchecked") Map<String, String> launch = configuration.getAttribute(Attribute.PROVISION_ITEMS, new HashMap<Object, Object>()); - bundles = launch; + + for (Map.Entry<String, String> e : launch.entrySet()) { + BundleEntry be = new BundleEntry(new LaunchURL(e.getKey()), e.getValue()); + bundles.put(be.getArtifactUrl(), be); + } } catch (CoreException e) { - bundles = new HashMap<String, String>(); } } public void add(BundleEntry e) { - add(e.getURL(), e.getOptions()); - } - - public void add(String url, String options) { - bundles.put(url, options); + bundles.put(e.getArtifactUrl(), e); } - public boolean containsURL(String url) { + public boolean containsURL(ArtifactURL url) { return bundles.containsKey(url); } - public BundleEntry find(String url) { - String options = bundles.get(url); - if(options != null) - return new BundleEntry(url, options); - else - return null; + public BundleEntry find(ArtifactURL url) { + return bundles.get(url); } - public Set<String> allURLs() { + public Set<ArtifactURL> allURLs() { return bundles.keySet(); } - private static class BundleIterator implements Iterator<BundleEntry> { - Iterator<Map.Entry<String, String>> iter; - - public BundleIterator(Iterator<Map.Entry<String, String>> iter) { - this.iter = iter; - } - - public boolean hasNext() { - return iter.hasNext(); - } - - public BundleEntry next() { - Map.Entry<String, String> e = iter.next(); - return new BundleEntry(e.getKey(), e.getValue()); - } - - public void remove() { - iter.remove(); - } - - } - public int size() { return bundles.size(); } - - public void removeURL(String url) { - bundles.remove(url); + + public boolean removeURL(ArtifactURL url) { + return bundles.remove(url) != null; } @Override public String toString() { return bundles.toString(); } - + public void removeAll(Collection<BundleEntry> entries) { - for(BundleEntry e: entries) - bundles.remove(e.getURL()); + for (BundleEntry e : entries) + remove(e); } - + public boolean remove(BundleEntry be) { - return bundles.remove(be.getURL()) != null; + return removeURL(be.getArtifactUrl()); } - + public void addAll(Collection<BundleEntry> entries) { - for(BundleEntry e: entries) - bundles.put(e.getURL(), e.getOptions()); + for (BundleEntry e : entries) + add(e); } public void updateBundleOptions(BundleEntry be) { - if(!bundles.containsKey(be.getURL())) // to be sure + if (!bundles.containsKey(be.getLaunchUrl())) // to be sure throw new IllegalArgumentException("can only update options of already existing bundle"); - bundles.put(be.getURL(), be.getOptions()); + bundles.put(be.getArtifactUrl(), be); // be is immutable, so its ok } } diff --git a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/HardcodedConfigProvider.java b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/HardcodedConfigProvider.java index 9734d6e4a1f8454bd7c85c85eb361aa23051dee2..b166b0bc612e9edf90aee2f649344fd96b245fb5 100644 --- a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/HardcodedConfigProvider.java +++ b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/HardcodedConfigProvider.java @@ -21,7 +21,6 @@ package org.universaal.uaalpax.model; import java.util.Collection; -import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -30,143 +29,130 @@ import java.util.Set; public class HardcodedConfigProvider implements UAALVersionProvider { private static Map<String, BundleSet> middlewares = new HashMap<String, BundleSet>(); private static Map<String, Map<String, BundleSet>> features = new HashMap<String, Map<String, BundleSet>>(); - private static Map<String, Set<String>> versionSegnificantURLs = new HashMap<String, Set<String>>(); - private static BundleSet ignoreSet; + private static Map<String, Set<ArtifactURL>> versionSegnificantURLs = new HashMap<String, Set<ArtifactURL>>(); + private static Set<String> ignoreSet; private static final BundleEntry[] m111_snapshot = new BundleEntry[] { - new BundleEntry("mvn:org.apache.felix/org.apache.felix.configadmin/1.2.4", "true@true@2@false"), - new BundleEntry("mvn:org.osgi/org.osgi.compendium/4.2.0", "true@true@2@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.acl.interfaces/1.1.1-SNAPSHOT", "true@true@2@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.bus.context/1.1.1-SNAPSHOT", "true@true@5@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.bus.model/1.1.1-SNAPSHOT", "true@true@3@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.bus.service/1.1.1-SNAPSHOT", "true@true@5@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.container.osgi/1.1.1-SNAPSHOT", "true@true@3@true"), - new BundleEntry("mvn:org.universAAL.middleware/mw.container.xfaces/1.1.1-SNAPSHOT", "true@true@2@true"), - new BundleEntry("mvn:org.universAAL.middleware/mw.data.representation/1.1.1-SNAPSHOT", "true@true@4@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.data.serialization/1.1.1-SNAPSHOT", "true@true@4@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.apache.felix.configadmin/1.2.4"), "true@true@2@false"), + new BundleEntry(new LaunchURL("mvn:org.osgi/org.osgi.compendium/4.2.0"), "true@true@2@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.acl.interfaces/1.1.1-SNAPSHOT"), "true@true@2@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.bus.context/1.1.1-SNAPSHOT"), "true@true@5@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.bus.model/1.1.1-SNAPSHOT"), "true@true@3@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.bus.service/1.1.1-SNAPSHOT"), "true@true@5@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.container.osgi/1.1.1-SNAPSHOT"), "true@true@3@true"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.container.xfaces/1.1.1-SNAPSHOT"), "true@true@2@true"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.data.representation/1.1.1-SNAPSHOT"), "true@true@4@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.data.serialization/1.1.1-SNAPSHOT"), "true@true@4@false"), - new BundleEntry("wrap:mvn:java3d/j3d-core/1.3.1", "true@true@2@false"), - new BundleEntry("wrap:mvn:java3d/vecmath/1.3.1", "true@true@2@false"), - new BundleEntry("wrap:mvn:jp.go.ipa/jgcl/1.0", "true@true@2@false"), - new BundleEntry("wrap:mvn:org.bouncycastle/jce.jdk13/144", "true@true@2@false"), - new BundleEntry("wrap:mvn:org.ops4j.pax.confman/pax-confman-propsloader/0.2.2", "true@true@3@false"), + new BundleEntry(new LaunchURL("wrap:mvn:java3d/j3d-core/1.3.1"), "true@true@2@false"), + new BundleEntry(new LaunchURL("wrap:mvn:java3d/vecmath/1.3.1"), "true@true@2@false"), + new BundleEntry(new LaunchURL("wrap:mvn:jp.go.ipa/jgcl/1.0"), "true@true@2@false"), + new BundleEntry(new LaunchURL("wrap:mvn:org.bouncycastle/jce.jdk13/144"), "true@true@2@false"), + new BundleEntry(new LaunchURL("wrap:mvn:org.ops4j.pax.confman/pax-confman-propsloader/0.2.2"), "true@true@3@false"), - new BundleEntry("wrap:mvn:org.ops4j.pax.logging/pax-logging-api/1.6.2", "true@true@2@false"), - new BundleEntry("wrap:mvn:org.ops4j.pax.logging/pax-logging-service/1.6.2", "true@true@3@false"), }; + new BundleEntry(new LaunchURL("wrap:mvn:org.ops4j.pax.logging/pax-logging-api/1.6.2"), "true@true@2@false"), + new BundleEntry(new LaunchURL("wrap:mvn:org.ops4j.pax.logging/pax-logging-service/1.6.2"), "true@true@3@false"), }; - private static final String[] vsu111_snapshot = new String[] { - "mvn:org.universAAL.middleware/mw.acl.interfaces/1.1.1-SNAPSHOT", - "mvn:org.universAAL.middleware/mw.bus.context/1.1.1-SNAPSHOT", - "mvn:org.universAAL.middleware/mw.bus.model/1.1.1-SNAPSHOT", - "mvn:org.universAAL.middleware/mw.bus.service/1.1.1-SNAPSHOT", - "mvn:org.universAAL.middleware/mw.container.osgi/1.1.1-SNAPSHOT", - "mvn:org.universAAL.middleware/mw.container.xfaces/1.1.1-SNAPSHOT", - "mvn:org.universAAL.middleware/mw.data.representation/1.1.1-SNAPSHOT", - "mvn:org.universAAL.middleware/mw.data.serialization/1.1.1-SNAPSHOT", }; + private static final String[] vsu111_snapshot = new String[] { "org.universAAL.middleware/mw.acl.interfaces/1.1.1-SNAPSHOT", + "org.universAAL.middleware/mw.bus.context/1.1.1-SNAPSHOT", "org.universAAL.middleware/mw.bus.model/1.1.1-SNAPSHOT", + "org.universAAL.middleware/mw.bus.service/1.1.1-SNAPSHOT", + "org.universAAL.middleware/mw.container.osgi/1.1.1-SNAPSHOT", + "org.universAAL.middleware/mw.container.xfaces/1.1.1-SNAPSHOT", + "org.universAAL.middleware/mw.data.representation/1.1.1-SNAPSHOT", + "org.universAAL.middleware/mw.data.serialization/1.1.1-SNAPSHOT", }; private static final BundleEntry[] m120 = new BundleEntry[] { - new BundleEntry("mvn:org.universAAL.middleware/mw.container.xfaces.osgi/1.2.0", "true@true@2@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.acl.interfaces.osgi/1.2.0", "true@true@3@false"), - new BundleEntry("mvn:org.ops4j.pax.logging/pax-logging-api/1.6.2", "true@true@4@false"), - new BundleEntry("mvn:org.ops4j.pax.logging/pax-logging-service/1.6.2", "true@true@5@false"), - new BundleEntry("mvn:org.apache.felix/org.osgi.compendium/1.4.0", "true@true@6@false"), - new BundleEntry("mvn:org.apache.felix/org.apache.felix.log/1.0.1", "true@true@7@false"), - new BundleEntry("mvn:org.apache.felix/org.apache.felix.configadmin/1.2.4", "true@true@8@false"), - new BundleEntry("mvn:org.apache.felix/org.apache.felix.fileinstall/3.1.10", "true@true@9@false"), - new BundleEntry("mvn:org.ops4j.pax.confman/pax-confman-propsloader/0.2.2", "true@true@10@false"), - new BundleEntry("mvn:org.apache.felix/org.apache.felix.bundlerepository/1.4.2", "true@true@11@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.container.osgi/1.2.0", "true@true@12@false"), - new BundleEntry("wrap:mvn:org.bouncycastle/jce.jdk13/144", "true@true@13@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.acl.upnp.osgi/1.2.0", "true@true@14@false"), - new BundleEntry("mvn:org.apache.felix/org.apache.felix.upnp.basedriver/0.8.0", "true@true@15@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.bus.model.osgi/1.2.0", "true@true@16@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.data.representation.osgi/1.2.0", "true@true@17@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.bus.service.osgi/1.2.0", "true@true@18@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.bus.context.osgi/1.2.0", "true@true@19@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.data.serialization.osgi/1.2.0", "true@true@20@false"), - new BundleEntry("wrap:mvn:java3d/vecmath/1.3.1", "true@true@21@false"), - new BundleEntry("wrap:mvn:java3d/j3d-core/1.3.1", "true@true@22@false"), - new BundleEntry("wrap:mvn:jp.go.ipa/jgcl/1.0", "true@true@23@false"), }; + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.container.xfaces.osgi/1.2.0"), "true@true@2@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.acl.interfaces.osgi/1.2.0"), "true@true@3@false"), + new BundleEntry(new LaunchURL("mvn:org.ops4j.pax.logging/pax-logging-api/1.6.2"), "true@true@4@false"), + new BundleEntry(new LaunchURL("mvn:org.ops4j.pax.logging/pax-logging-service/1.6.2"), "true@true@5@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.osgi.compendium/1.4.0"), "true@true@6@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.apache.felix.log/1.0.1"), "true@true@7@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.apache.felix.configadmin/1.2.4"), "true@true@8@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.apache.felix.fileinstall/3.1.10"), "true@true@9@false"), + new BundleEntry(new LaunchURL("mvn:org.ops4j.pax.confman/pax-confman-propsloader/0.2.2"), "true@true@10@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.apache.felix.bundlerepository/1.4.2"), "true@true@11@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.container.osgi/1.2.0"), "true@true@12@false"), + new BundleEntry(new LaunchURL("wrap:mvn:org.bouncycastle/jce.jdk13/144"), "true@true@13@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.acl.upnp.osgi/1.2.0"), "true@true@14@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.apache.felix.upnp.basedriver/0.8.0"), "true@true@15@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.bus.model.osgi/1.2.0"), "true@true@16@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.data.representation.osgi/1.2.0"), "true@true@17@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.bus.service.osgi/1.2.0"), "true@true@18@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.bus.context.osgi/1.2.0"), "true@true@19@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.data.serialization.osgi/1.2.0"), "true@true@20@false"), + new BundleEntry(new LaunchURL("wrap:mvn:java3d/vecmath/1.3.1"), "true@true@21@false"), + new BundleEntry(new LaunchURL("wrap:mvn:java3d/j3d-core/1.3.1"), "true@true@22@false"), + new BundleEntry(new LaunchURL("wrap:mvn:jp.go.ipa/jgcl/1.0"), "true@true@23@false"), }; - private static final String[] vsu120 = new String[] { - "mvn:org.universAAL.middleware/mw.container.xfaces.osgi/1.2.0", - "mvn:org.universAAL.middleware/mw.acl.interfaces.osgi/1.2.0", - "mvn:org.universAAL.middleware/mw.container.osgi/1.2.0", - "mvn:org.universAAL.middleware/mw.bus.model.osgi/1.2.0", - "mvn:org.universAAL.middleware/mw.data.representation.osgi/1.2.0", - "mvn:org.universAAL.middleware/mw.bus.service.osgi/1.2.0", - "mvn:org.universAAL.middleware/mw.bus.context.osgi/1.2.0", - "mvn:org.universAAL.middleware/mw.data.serialization.osgi/1.2.0" }; + private static final String[] vsu120 = new String[] { "org.universAAL.middleware/mw.container.xfaces.osgi/1.2.0", + "org.universAAL.middleware/mw.acl.interfaces.osgi/1.2.0", "org.universAAL.middleware/mw.container.osgi/1.2.0", + "org.universAAL.middleware/mw.bus.model.osgi/1.2.0", "org.universAAL.middleware/mw.data.representation.osgi/1.2.0", + "org.universAAL.middleware/mw.bus.service.osgi/1.2.0", "org.universAAL.middleware/mw.bus.context.osgi/1.2.0", + "org.universAAL.middleware/mw.data.serialization.osgi/1.2.0" }; private static final BundleEntry[] m121_snapshot = new BundleEntry[] { - new BundleEntry("mvn:org.universAAL.middleware/mw.container.xfaces.osgi/1.2.1-SNAPSHOT", - "true@true@2@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.acl.interfaces.osgi/1.2.1-SNAPSHOT", "true@true@3@false"), - new BundleEntry("mvn:org.ops4j.pax.logging/pax-logging-api/1.6.2", "true@true@4@false"), - new BundleEntry("mvn:org.ops4j.pax.logging/pax-logging-service/1.6.2", "true@true@5@false"), - new BundleEntry("mvn:org.apache.felix/org.osgi.compendium/1.4.0", "true@true@6@false"), - new BundleEntry("mvn:org.apache.felix/org.apache.felix.log/1.0.1", "true@true@7@false"), - new BundleEntry("mvn:org.apache.felix/org.apache.felix.configadmin/1.2.4", "true@true@8@false"), - new BundleEntry("mvn:org.apache.felix/org.apache.felix.fileinstall/3.1.10", "true@true@9@false"), - new BundleEntry("mvn:org.ops4j.pax.confman/pax-confman-propsloader/0.2.2", "true@true@10@false"), - new BundleEntry("mvn:org.apache.felix/org.apache.felix.bundlerepository/1.4.2", "true@true@11@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.container.osgi/1.2.1-SNAPSHOT", "true@true@12@false"), - new BundleEntry("wrap:mvn:org.bouncycastle/jce.jdk13/144", "true@true@13@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.acl.upnp.osgi/1.2.1-SNAPSHOT", "true@true@14@false"), - new BundleEntry("mvn:org.apache.felix/org.apache.felix.upnp.basedriver/0.8.0", "true@true@15@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.bus.model.osgi/1.2.1-SNAPSHOT", "true@true@16@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.data.representation.osgi/1.2.1-SNAPSHOT", - "true@true@17@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.bus.service.osgi/1.2.1-SNAPSHOT", "true@true@18@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.bus.context.osgi/1.2.1-SNAPSHOT", "true@true@19@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.data.serialization.osgi/1.2.1-SNAPSHOT", - "true@true@20@false"), new BundleEntry("wrap:mvn:java3d/vecmath/1.3.1", "true@true@21@false"), - new BundleEntry("wrap:mvn:java3d/j3d-core/1.3.1", "true@true@22@false"), - new BundleEntry("wrap:mvn:jp.go.ipa/jgcl/1.0", "true@true@23@false"), }; + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.container.xfaces.osgi/1.2.1-SNAPSHOT"), "true@true@2@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.acl.interfaces.osgi/1.2.1-SNAPSHOT"), "true@true@3@false"), + new BundleEntry(new LaunchURL("mvn:org.ops4j.pax.logging/pax-logging-api/1.6.2"), "true@true@4@false"), + new BundleEntry(new LaunchURL("mvn:org.ops4j.pax.logging/pax-logging-service/1.6.2"), "true@true@5@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.osgi.compendium/1.4.0"), "true@true@6@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.apache.felix.log/1.0.1"), "true@true@7@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.apache.felix.configadmin/1.2.4"), "true@true@8@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.apache.felix.fileinstall/3.1.10"), "true@true@9@false"), + new BundleEntry(new LaunchURL("mvn:org.ops4j.pax.confman/pax-confman-propsloader/0.2.2"), "true@true@10@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.apache.felix.bundlerepository/1.4.2"), "true@true@11@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.container.osgi/1.2.1-SNAPSHOT"), "true@true@12@false"), + new BundleEntry(new LaunchURL("wrap:mvn:org.bouncycastle/jce.jdk13/144"), "true@true@13@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.acl.upnp.osgi/1.2.1-SNAPSHOT"), "true@true@14@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.apache.felix.upnp.basedriver/0.8.0"), "true@true@15@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.bus.model.osgi/1.2.1-SNAPSHOT"), "true@true@16@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.data.representation.osgi/1.2.1-SNAPSHOT"), "true@true@17@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.bus.service.osgi/1.2.1-SNAPSHOT"), "true@true@18@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.bus.context.osgi/1.2.1-SNAPSHOT"), "true@true@19@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.data.serialization.osgi/1.2.1-SNAPSHOT"), "true@true@20@false"), + new BundleEntry(new LaunchURL("wrap:mvn:java3d/vecmath/1.3.1"), "true@true@21@false"), + new BundleEntry(new LaunchURL("wrap:mvn:java3d/j3d-core/1.3.1"), "true@true@22@false"), + new BundleEntry(new LaunchURL("wrap:mvn:jp.go.ipa/jgcl/1.0"), "true@true@23@false"), }; - private static final String[] vsu121_snapshot = new String[] { - "mvn:org.universAAL.middleware/mw.container.xfaces.osgi/1.2.1-SNAPSHOT", - "mvn:org.universAAL.middleware/mw.acl.interfaces.osgi/1.2.1-SNAPSHOT", - "mvn:org.universAAL.middleware/mw.container.osgi/1.2.1-SNAPSHOT", - "mvn:org.universAAL.middleware/mw.bus.model.osgi/1.2.1-SNAPSHOT", - "mvn:org.universAAL.middleware/mw.data.representation.osgi/1.2.1-SNAPSHOT", - "mvn:org.universAAL.middleware/mw.bus.service.osgi/1.2.1-SNAPSHOT", - "mvn:org.universAAL.middleware/mw.bus.context.osgi/1.2.1-SNAPSHOT", - "mvn:org.universAAL.middleware/mw.data.serialization.osgi/1.2.1-SNAPSHOT" }; + private static final String[] vsu121_snapshot = new String[] { "org.universAAL.middleware/mw.container.xfaces.osgi/1.2.1-SNAPSHOT", + "org.universAAL.middleware/mw.acl.interfaces.osgi/1.2.1-SNAPSHOT", + "org.universAAL.middleware/mw.container.osgi/1.2.1-SNAPSHOT", + "org.universAAL.middleware/mw.bus.model.osgi/1.2.1-SNAPSHOT", + "org.universAAL.middleware/mw.data.representation.osgi/1.2.1-SNAPSHOT", + "org.universAAL.middleware/mw.bus.service.osgi/1.2.1-SNAPSHOT", + "org.universAAL.middleware/mw.bus.context.osgi/1.2.1-SNAPSHOT", + "org.universAAL.middleware/mw.data.serialization.osgi/1.2.1-SNAPSHOT" }; private static final BundleEntry[] m130 = new BundleEntry[] { - new BundleEntry("mvn:org.universAAL.middleware/mw.container.xfaces.osgi/1.3.0", "true@true@2@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.acl.interfaces.osgi/1.3.0", "true@true@3@false"), - new BundleEntry("mvn:org.ops4j.pax.logging/pax-logging-api/1.6.2", "true@true@4@false"), - new BundleEntry("mvn:org.ops4j.pax.logging/pax-logging-service/1.6.2", "true@true@5@false"), - new BundleEntry("mvn:org.apache.felix/org.osgi.compendium/1.4.0", "true@true@6@false"), - new BundleEntry("mvn:org.apache.felix/org.apache.felix.log/1.0.1", "true@true@7@false"), - new BundleEntry("mvn:org.apache.felix/org.apache.felix.configadmin/1.2.4", "true@true@8@false"), - new BundleEntry("mvn:org.apache.felix/org.apache.felix.fileinstall/3.1.10", "true@true@9@false"), - new BundleEntry("mvn:org.ops4j.pax.confman/pax-confman-propsloader/0.2.2", "true@true@10@false"), - new BundleEntry("mvn:org.apache.felix/org.apache.felix.bundlerepository/1.4.2", "true@true@11@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.container.osgi/1.3.0", "true@true@12@false"), - new BundleEntry("wrap:mvn:org.bouncycastle/jce.jdk13/144", "true@true@13@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.acl.upnp.osgi/1.3.0", "true@true@14@false"), - new BundleEntry("mvn:org.apache.felix/org.apache.felix.upnp.basedriver/0.8.0", "true@true@15@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.bus.model.osgi/1.3.0", "true@true@16@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.data.representation.osgi/1.3.0", "true@true@17@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.bus.service.osgi/1.3.0", "true@true@18@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.bus.context.osgi/1.3.0", "true@true@19@false"), - new BundleEntry("mvn:org.universAAL.middleware/mw.data.serialization.osgi/1.3.0", "true@true@20@false"), - new BundleEntry("wrap:mvn:java3d/vecmath/1.3.1", "true@true@21@false"), - new BundleEntry("wrap:mvn:java3d/j3d-core/1.3.1", "true@true@22@false"), - new BundleEntry("wrap:mvn:jp.go.ipa/jgcl/1.0", "true@true@23@false"), }; + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.container.xfaces.osgi/1.3.0"), "true@true@2@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.acl.interfaces.osgi/1.3.0"), "true@true@3@false"), + new BundleEntry(new LaunchURL("mvn:org.ops4j.pax.logging/pax-logging-api/1.6.2"), "true@true@4@false"), + new BundleEntry(new LaunchURL("mvn:org.ops4j.pax.logging/pax-logging-service/1.6.2"), "true@true@5@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.osgi.compendium/1.4.0"), "true@true@6@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.apache.felix.log/1.0.1"), "true@true@7@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.apache.felix.configadmin/1.2.4"), "true@true@8@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.apache.felix.fileinstall/3.1.10"), "true@true@9@false"), + new BundleEntry(new LaunchURL("mvn:org.ops4j.pax.confman/pax-confman-propsloader/0.2.2"), "true@true@10@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.apache.felix.bundlerepository/1.4.2"), "true@true@11@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.container.osgi/1.3.0"), "true@true@12@false"), + new BundleEntry(new LaunchURL("wrap:mvn:org.bouncycastle/jce.jdk13/144"), "true@true@13@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.acl.upnp.osgi/1.3.0"), "true@true@14@false"), + new BundleEntry(new LaunchURL("mvn:org.apache.felix/org.apache.felix.upnp.basedriver/0.8.0"), "true@true@15@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.bus.model.osgi/1.3.0"), "true@true@16@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.data.representation.osgi/1.3.0"), "true@true@17@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.bus.service.osgi/1.3.0"), "true@true@18@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.bus.context.osgi/1.3.0"), "true@true@19@false"), + new BundleEntry(new LaunchURL("mvn:org.universAAL.middleware/mw.data.serialization.osgi/1.3.0"), "true@true@20@false"), + new BundleEntry(new LaunchURL("wrap:mvn:java3d/vecmath/1.3.1"), "true@true@21@false"), + new BundleEntry(new LaunchURL("wrap:mvn:java3d/j3d-core/1.3.1"), "true@true@22@false"), + new BundleEntry(new LaunchURL("wrap:mvn:jp.go.ipa/jgcl/1.0"), "true@true@23@false"), }; - private static final String[] vsu130 = new String[] { - "mvn:org.universAAL.middleware/mw.container.xfaces.osgi/1.3.0", - "mvn:org.universAAL.middleware/mw.acl.interfaces.osgi/1.3.0", - "mvn:org.universAAL.middleware/mw.container.osgi/1.3.0", - "mvn:org.universAAL.middleware/mw.bus.model.osgi/1.3.0", - "mvn:org.universAAL.middleware/mw.data.representation.osgi/1.3.0", - "mvn:org.universAAL.middleware/mw.bus.service.osgi/1.3.0", - "mvn:org.universAAL.middleware/mw.bus.context.osgi/1.3.0", - "mvn:org.universAAL.middleware/mw.data.serialization.osgi/1.3.0" }; + private static final String[] vsu130 = new String[] { "org.universAAL.middleware/mw.container.xfaces.osgi/1.3.0", + "org.universAAL.middleware/mw.acl.interfaces.osgi/1.3.0", "org.universAAL.middleware/mw.container.osgi/1.3.0", + "org.universAAL.middleware/mw.bus.model.osgi/1.3.0", "org.universAAL.middleware/mw.data.representation.osgi/1.3.0", + "org.universAAL.middleware/mw.bus.service.osgi/1.3.0", "org.universAAL.middleware/mw.bus.context.osgi/1.3.0", + "org.universAAL.middleware/mw.data.serialization.osgi/1.3.0" }; static { registerVersion("1.1.1-SNAPSHOT", m111_snapshot, vsu111_snapshot); @@ -175,33 +161,34 @@ public class HardcodedConfigProvider implements UAALVersionProvider { registerVersion("1.3.0", m130, vsu130); // create ignore set - ignoreSet = new BundleSet(); - ignoreSet.add(new BundleEntry("mvn:org.apache.felix/org.apache.felix.main", true, true, 1, true)); - ignoreSet.add(new BundleEntry("mvn:org.apache.felix/org.apache.felix.framework", true, true, 1, true)); - ignoreSet.add(new BundleEntry("mvn:org.apache.felix/org.osgi.core", true, true, 1, true)); - ignoreSet.add(new BundleEntry("mvn:org.apache.felix/org.apache.felix.bundlerepository", true, true, 1, true)); - ignoreSet.add(new BundleEntry("mvn:org.apache.felix/org.apache.felix.shell", true, true, 1, true)); - ignoreSet.add(new BundleEntry("mvn:org.apache.felix/org.apache.felix.shell.tui", true, true, 1, true)); - ignoreSet.add(new BundleEntry("mvn:org.apache.felix/org.osgi.compendium", true, true, 1, true)); - // ignoreSet.add(new BundleEntry("mvn:org.ops4j.pax.logging/pax-logging-api/1.6.2", true, true, 1, true)); - // ignoreSet.add(new BundleEntry("mvn:org.ops4j.pax.logging/pax-logging-service/1.6.2", true, true, 1, true)); - ignoreSet.add(new BundleEntry("mvn:org.ops4j.pax.logging/pax-logging-api", true, true, 1, true)); - ignoreSet.add(new BundleEntry("mvn:org.ops4j.pax.logging/pax-logging-service", true, true, 1, true)); - ignoreSet.add(new BundleEntry("mvn:org.apache.felix/javax.servlet", true, true, 1, true)); + ignoreSet = new HashSet<String>(); + ignoreSet.add("org.apache.felix/org.apache.felix.main"); - ignoreSet.add(new BundleEntry("wrap:mvn:org.ops4j.pax.logging/pax-logging-service", true, true, 1, true)); - ignoreSet.add(new BundleEntry("wrap:mvn:org.ops4j.pax.logging/pax-logging-api", true, true, 1, true)); + ignoreSet.add("org.apache.felix/org.apache.felix.framework"); + ignoreSet.add("org.apache.felix/org.osgi.core"); + ignoreSet.add("org.apache.felix/org.apache.felix.bundlerepository"); + ignoreSet.add("org.apache.felix/org.apache.felix.shell"); + ignoreSet.add("org.apache.felix/org.apache.felix.shell.tui"); + ignoreSet.add("org.apache.felix/org.osgi.compendium"); + // ignoreSet.add("org.ops4j.pax.logging/pax-logging-api/1.6.2"); + // ignoreSet.add("org.ops4j.pax.logging/pax-logging-service/1.6.2"); + ignoreSet.add("org.ops4j.pax.logging/pax-logging-api"); + ignoreSet.add("org.ops4j.pax.logging/pax-logging-service"); + ignoreSet.add("org.apache.felix/javax.servlet"); - ignoreSet.add(new BundleEntry("mvn:java3d/j3d-core/1.3.1", true, true, 1, true)); - ignoreSet.add(new BundleEntry("mvn:java3d/vecmath/1.3.1", true, true, 1, true)); - ignoreSet.add(new BundleEntry("mvn:jp.go.ipa/jgcl/1.0", true, true, 1, true)); - ignoreSet.add(new BundleEntry("mvn:org.bouncycastle/jce.jdk13/144", true, true, 1, true)); + ignoreSet.add("wrap:mvn:org.ops4j.pax.logging/pax-logging-service"); + ignoreSet.add("wrap:mvn:org.ops4j.pax.logging/pax-logging-api"); - ignoreSet.add(new BundleEntry("mvn:org.universAAL.middleware/mw.composite", true, true, 1, true)); + ignoreSet.add("java3d/j3d-core/1.3.1"); + ignoreSet.add("java3d/vecmath/1.3.1"); + ignoreSet.add("jp.go.ipa/jgcl/1.0"); + ignoreSet.add("org.bouncycastle/jce.jdk13/144"); - ignoreSet.add(new BundleEntry("mvn:javax.media/jmf", true, true, 1, true)); - ignoreSet.add(new BundleEntry("mvn:org.apache.felix/org.osgi.foundation", true, true, 1, true)); - ignoreSet.add(new BundleEntry("mvn:org.apache.felix/org.apache.felix.log", true, true, 1, true)); + ignoreSet.add("org.universAAL.middleware/mw.composite"); + + ignoreSet.add("javax.media/jmf"); + ignoreSet.add("org.apache.felix/org.osgi.foundation"); + ignoreSet.add("org.apache.felix/org.apache.felix.log"); } private static void registerVersion(String version, BundleEntry[] bundles, String[] significant) { @@ -210,8 +197,9 @@ public class HardcodedConfigProvider implements UAALVersionProvider { bs.add(pu); middlewares.put(version, bs); - Set<String> s = new HashSet<String>(); - Collections.addAll(s, significant); + Set<ArtifactURL> s = new HashSet<ArtifactURL>(); + for (String sig : significant) + s.add(new ArtifactURL(sig)); versionSegnificantURLs.put(version, s); } @@ -239,18 +227,14 @@ public class HardcodedConfigProvider implements UAALVersionProvider { return f.get(feature); } - public BundleSet getIgnoreBundlesOfVersion(String version) { - return ignoreSet; - } - - public boolean isIgnoreBundleOfVersion(BundleEntry be, String version) { - for (BundleEntry ignore : ignoreSet) - if (be.getURL().startsWith(ignore.getURL())) + public boolean isIgnoreArtifactOfVersion(String version, ArtifactURL artifactUrl) { + for (String ignore : ignoreSet) + if (artifactUrl.url.startsWith(ignore)) return true; - if (be.getURL().contains(".core")) - return true; // TODO - + // if (launchUrl.contains(".core")) + // return true; // TODO + // check if it is a .core bundle and the corresponding .osgi bundle is already contained in version // TODO // int pos = be.getURL().lastIndexOf(".core"); @@ -262,13 +246,13 @@ public class HardcodedConfigProvider implements UAALVersionProvider { return false; } - public float getVersionScore(String version, Collection<String> urls) { - Set<String> vsu = versionSegnificantURLs.get(version); + public float getVersionScore(String version, Collection<ArtifactURL> urls) { + Set<ArtifactURL> vsu = versionSegnificantURLs.get(version); if (vsu == null) return 0; int hits = 0; - for (String url : vsu) + for (ArtifactURL url : vsu) if (urls.contains(url)) hits++; diff --git a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/ModelDialogProvider.java b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/ModelDialogProvider.java index 20b2e445fe5109ff0809167b9d8da52ab4d53823..5c759d384af0c7ef85818e593f41c4aaa4eb5b2d 100644 --- a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/ModelDialogProvider.java +++ b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/ModelDialogProvider.java @@ -1,7 +1,11 @@ package org.universaal.uaalpax.model; +import org.eclipse.swt.widgets.Shell; + public interface ModelDialogProvider { public int openDialog(String title, String message, String... buttons); public void showErrorMessage(String title, String message); + + public Shell getShell(); } diff --git a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/UAALVersionProvider.java b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/UAALVersionProvider.java index a59a483db8c27107d1dfee166addd296245a2614..a8fa8c7183711f7b4ed242f50d823261fcc2a62c 100644 --- a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/UAALVersionProvider.java +++ b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/model/UAALVersionProvider.java @@ -69,11 +69,11 @@ public interface UAALVersionProvider { /** * Checks whether given bundle should be ignored (-> not added to the run config since it is not necessary) using given middleware version. * - * @param be BundleEntry + * @param launchUrl launch url * @param version middleware version * @return true if bundle should be ignored, otherwise false */ - public boolean isIgnoreBundleOfVersion(BundleEntry be, String version); + public boolean isIgnoreArtifactOfVersion(String version, ArtifactURL launchUrl); /** * Computes how probably the given bundle urls represent a run config of a certain uaal version. @@ -82,5 +82,5 @@ public interface UAALVersionProvider { * @param urls set of bundle urls in run config * @return version hit score for given version, between 0.0 and 1.0 */ - public float getVersionScore(String version, Collection<String> urls); + public float getVersionScore(String version, Collection<ArtifactURL> urls); } diff --git a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/shared/MavenDependencyResolver.java b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/shared/MavenDependencyResolver.java index 99c0a1d9616c1b4bb7866cc7c02d27838175e9d9..0658d52083b71da57ddc883d7b9e1c3d33f2e349 100644 --- a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/shared/MavenDependencyResolver.java +++ b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/shared/MavenDependencyResolver.java @@ -47,6 +47,7 @@ import org.sonatype.aether.resolution.ArtifactRequest; import org.sonatype.aether.resolution.ArtifactResolutionException; import org.sonatype.aether.resolution.ArtifactResult; import org.sonatype.aether.util.artifact.JavaScopes; +import org.universaal.uaalpax.model.ArtifactURL; import org.universaal.uaalpax.model.BundleEntry; import aether.demo.util.Booter; @@ -57,7 +58,8 @@ public class MavenDependencyResolver { private RepositorySystemSession session; private List<RemoteRepository> repos; - private Map<Object, DependencyNode> resolvingCache; + private Map<Object, DependencyNode> dependencyCache; + private Map<Artifact, Artifact> artifactCache; private Composite guiParent; @@ -66,7 +68,8 @@ public class MavenDependencyResolver { session = Booter.newRepositorySystemSession(system); repos = Booter.newRepositories(); - resolvingCache = new HashMap<Object, DependencyNode>(); + dependencyCache = new HashMap<Object, DependencyNode>(); + artifactCache = new HashMap<Artifact, Artifact>(); } public void setGUIParent(Composite guiParent) { @@ -75,7 +78,7 @@ public class MavenDependencyResolver { } public void clearCache() { - resolvingCache.clear(); + dependencyCache.clear(); } public List<Dependency> getDirectDependencies(Artifact artifact) throws ArtifactDescriptorException { @@ -89,24 +92,29 @@ public class MavenDependencyResolver { } public Artifact resolveArtifact(Artifact artifact) { - ArtifactRequest artifactRequest = new ArtifactRequest(); - artifactRequest.setArtifact(artifact); - artifactRequest.setRepositories(Booter.newRepositories()); + Artifact resolved = artifactCache.get(artifact); - ArtifactResult artifactResult; - try { - artifactResult = system.resolveArtifact(session, artifactRequest); - } catch (ArtifactResolutionException e) { - return null; + if (resolved == null) { + ArtifactRequest artifactRequest = new ArtifactRequest(); + artifactRequest.setArtifact(artifact); + artifactRequest.setRepositories(Booter.newRepositories()); + + try { + ArtifactResult artifactResult = system.resolveArtifact(session, artifactRequest); + resolved = artifactResult.getArtifact(); + artifactCache.put(artifact, resolved); + + } catch (ArtifactResolutionException e) { + } + } - - return artifactResult.getArtifact(); + return resolved; } - public DependencyNode resolve(Artifact artifact) throws DependencyCollectionException, TimeoutException { - String url = BundleEntry.urlFromArtifact(artifact); + public DependencyNode resolveDependencies(Artifact artifact) throws DependencyCollectionException, TimeoutException { + ArtifactURL url = BundleEntry.artifactUrlFromArtifact(artifact); - DependencyNode artifactResults = resolvingCache.get(url); + DependencyNode artifactResults = dependencyCache.get(url); if (artifactResults == null) { CollectRequest collectRequest = new CollectRequest(); collectRequest.setRoot(new Dependency(artifact, JavaScopes.COMPILE)); @@ -118,17 +126,35 @@ public class MavenDependencyResolver { return artifactResults; } + public DependencyNode resolveDependenciesBlocking(Artifact artifact) throws DependencyCollectionException { + System.out.println("resolving " + artifact); + ArtifactURL url = BundleEntry.artifactUrlFromArtifact(artifact); + + DependencyNode artifactResults = dependencyCache.get(url); + if (artifactResults == null) { + CollectRequest collectRequest = new CollectRequest(); + collectRequest.setRoot(new Dependency(artifact, JavaScopes.COMPILE)); + collectRequest.setRepositories(repos); + + artifactResults = system.collectDependencies(session, collectRequest).getRoot(); + cacheDependencies(artifactResults); + } + + System.out.println("resolved " + artifact); + return artifactResults; + } + private void cacheDependencies(DependencyNode node) { Dependency d = node.getDependency(); if (d != null && d.getArtifact() != null) - resolvingCache.put(BundleEntry.urlFromArtifact(d.getArtifact()), node); + dependencyCache.put(BundleEntry.artifactUrlFromArtifact(d.getArtifact()), node); for (DependencyNode child : node.getChildren()) cacheDependencies(child); } public DependencyNode resolve(Set<Artifact> artifacts) throws DependencyCollectionException, TimeoutException { - DependencyNode artifactResults = resolvingCache.get(artifacts); + DependencyNode artifactResults = dependencyCache.get(artifacts); if (artifactResults == null) { CollectRequest collectRequest = new CollectRequest(); for (Artifact a : artifacts) @@ -146,12 +172,33 @@ public class MavenDependencyResolver { final DependencyNode[] artifactResults = new DependencyNode[1]; final DependencyCollectionException[] exception = new DependencyCollectionException[1]; - ProgressMonitorDialog d = new ProgressMonitorDialog(guiParent.getShell()); + final Thread[] thread = new Thread[1]; + + ProgressMonitorDialog d = new ProgressMonitorDialog(guiParent.getShell()) { + @Override + protected void cancelPressed() { + super.cancelPressed(); + synchronized (thread) { + while (thread[0] == null) + try { + thread.wait(); + } catch (InterruptedException e) { + } + } + + thread[0].interrupt(); + } + }; + try { d.run(true, true, new IRunnableWithProgress() { - public void run(IProgressMonitor mon) throws InvocationTargetException, InterruptedException { try { + synchronized (thread) { + thread[0] = Thread.currentThread(); + thread.notify(); + } + mon.beginTask("dependency resolution", IProgressMonitor.UNKNOWN); mon.subTask("Retrieving metadata for bundles"); diff --git a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/AllLibsBlock.java b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/AllLibsBlock.java index 605c4c31dfad8061f3827178cde03e3fd3527ff3..e134d50540e2e5c319aafc72c8722eef2b24d55c 100644 --- a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/AllLibsBlock.java +++ b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/AllLibsBlock.java @@ -21,7 +21,6 @@ package org.universaal.uaalpax.ui; import java.util.ArrayList; -import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -174,7 +173,7 @@ public class AllLibsBlock extends UIBlock implements ProjectTable.BundleDoubleCl List<BundleEntry> projects = new ArrayList<BundleEntry>(allBundles.size()); for (BundleEntry e : allBundles) { projects.add(e); - if (!launchProjects.containsURL(e.getURL())) + if (!launchProjects.containsURL(e.getArtifactUrl())) grayOut[i++] = e; } diff --git a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/BundleComparator.java b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/BundleComparator.java index e1de591897ac4ee11e74bdbfb6af6d17fadbd4cc..4c6b8be69ca531f856495cc01bc173cf6063332f 100644 --- a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/BundleComparator.java +++ b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/BundleComparator.java @@ -61,7 +61,7 @@ public class BundleComparator extends ViewerComparator { int comp = 0; if (sortProperty == BundleEntry.PROP_PROJECT) - comp = be1.getURL().compareToIgnoreCase(be2.getURL()); + comp = be1.getLaunchUrl().url.compareToIgnoreCase(be2.getLaunchUrl().url); else if (sortProperty == BundleEntry.PROP_LEVEL) { if (be1.getLevel() < be2.getLevel()) comp = -1; diff --git a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/ProjectCellModifier.java b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/ProjectCellModifier.java index 3014f52b710757e23030ba94c5d06f4e4c6c292c..66235ead6db1de53ca7d43de6c9374d7088967cd 100644 --- a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/ProjectCellModifier.java +++ b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/ProjectCellModifier.java @@ -123,7 +123,6 @@ public class ProjectCellModifier implements ICellModifier { * A modify listener is notified on succesfull update of a modified cell. */ public interface ModifyListener { - /** * Notification on succesfull update. * diff --git a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/UniversAALTab.java b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/UniversAALTab.java index 1c5600fb28644923bd72b5721bd226bf30e6a33d..a266cc6f326d0bb32aa5d9afc03c75c53eb13442 100644 --- a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/UniversAALTab.java +++ b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/UniversAALTab.java @@ -22,8 +22,6 @@ package org.universaal.uaalpax.ui; import java.util.Collection; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.jface.dialogs.MessageDialog; @@ -40,6 +38,7 @@ import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.MessageBox; +import org.eclipse.swt.widgets.Shell; import org.universaal.uaalpax.model.BundleChangeListener; import org.universaal.uaalpax.model.BundleEntry; import org.universaal.uaalpax.model.BundleModel; @@ -70,8 +69,13 @@ public class UniversAALTab extends AbstractLauncherTab implements BundleChangeLi model.addChangeListener(this); } + public Shell getShell() { + return super.getShell(); + } + public void createControl(Composite parent) { dependencyResolver.setGUIParent(parent); + dependencyResolver.clearCache(); Composite container = new Composite(parent, SWT.NONE); @@ -122,7 +126,6 @@ public class UniversAALTab extends AbstractLauncherTab implements BundleChangeLi public void initializeFrom(ILaunchConfiguration configuration) { m_initializing = true; try { - dependencyResolver.clearCache(); launchConfig = configuration; model.updateModel(configuration); } finally { @@ -177,7 +180,7 @@ public class UniversAALTab extends AbstractLauncherTab implements BundleChangeLi public int openDialog(String title, String message, String... buttons) { return new MessageDialog(getShell(), title, null, message, MessageDialog.QUESTION, buttons, 0).open(); } - + public void showErrorMessage(String title, String message) { MessageBox mb = new MessageBox(getShell(), SWT.ICON_ERROR); mb.setMessage(message); diff --git a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/VersionBlock.java b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/VersionBlock.java index 365b0929459cf662b344ddf631ab6a8401bde7f9..10d9e545bae4796fe2163c7fc65f30820766d649 100644 --- a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/VersionBlock.java +++ b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/VersionBlock.java @@ -31,6 +31,7 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; +import org.universaal.uaalpax.model.ArtifactURL; import org.universaal.uaalpax.model.BundleSet; import org.universaal.uaalpax.model.BundleModel; @@ -82,17 +83,17 @@ public class VersionBlock extends UIBlock { Arrays.sort(versions); versionCombo.setItems(versions); int index = 0; - while(!versions[index].equals(version)) + while (!versions[index].equals(version)) index++; versionCombo.select(index); BundleSet bundles = model.getMiddlewareBundles(); - if(bundles == null) + if (bundles == null) return launchProjects; BundleSet remainingProjects = new BundleSet(launchProjects); - for (String url : bundles.allURLs()) + for (ArtifactURL url : bundles.allURLs()) if (launchProjects.containsURL(url)) remainingProjects.removeURL(url); @@ -115,7 +116,7 @@ public class VersionBlock extends UIBlock { public boolean tryChangeToVersion(String newVersion) { BundleModel model = getUAALTab().getModel(); // find out which projects have to be checked for compatibility - Set<String> toCheck = model.getIncompatibleProjects(newVersion); + Set<ArtifactURL> toCheck = model.getIncompatibleProjects(newVersion); // now to check only contains incompatible projects if (toCheck.isEmpty()) { // everything ok, no incompatible projects @@ -124,7 +125,7 @@ public class VersionBlock extends UIBlock { } else { // ask user what to do StringBuilder sb = new StringBuilder(); sb.append("Following projects are dependent from some bundles of the old version: \n\n"); - for (String url : toCheck) + for (ArtifactURL url : toCheck) sb.append("\t").append(url).append("\n"); sb.append("\nWhat do do?"); @@ -136,7 +137,7 @@ public class VersionBlock extends UIBlock { model.changeToVersion(newVersion); return true; } else if (ret == 1) { // remove incompatible - for (String url : toCheck) + for (ArtifactURL url : toCheck) getUAALTab().getModel().removeNoUpdate(getUAALTab().getModel().getBundles().find(url)); // model will be updated here diff --git a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/WorkspaceProjectsBlock.java b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/WorkspaceProjectsBlock.java index 31a5642c45f8f29ed67bace8231b737c6bc3e0f0..60ae6364517bfed769ce3d8909d5cdcd04cd6734 100644 --- a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/WorkspaceProjectsBlock.java +++ b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/WorkspaceProjectsBlock.java @@ -51,6 +51,7 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Layout; import org.universaal.uaalpax.model.BundleEntry; import org.universaal.uaalpax.model.BundleSet; +import org.universaal.uaalpax.model.LaunchURL; public class WorkspaceProjectsBlock extends UIBlock { private Button toRight, toLeft, allToRight, allToLeft; @@ -166,7 +167,7 @@ public class WorkspaceProjectsBlock extends UIBlock { } public void moveAllToLeft() { - List<BundleEntry> pus = new ArrayList<BundleEntry>(rightTable.getElements()); + Set<BundleEntry> pus = new HashSet<BundleEntry>(rightTable.getElements()); // rightTable.removeAll(); // leftTable.addAll(pus); getUAALTab().getModel().removeAll(pus); @@ -213,7 +214,7 @@ public class WorkspaceProjectsBlock extends UIBlock { * System.out.println(deps); } catch (DependencyCollectionException e) { // TODO Auto-generated catch block // * e.printStackTrace(); } */ - String launchUrl = "mvn:" + project.getGroupId() + "/" + project.getArtifactId() + "/" + project.getVersion(); + LaunchURL launchUrl = new LaunchURL("mvn:" + project.getGroupId() + "/" + project.getArtifactId() + "/" + project.getVersion()); // TODO cache previous settings BundleEntry pu = new BundleEntry(launchUrl, p.getName(), 12, true); @@ -240,10 +241,10 @@ public class WorkspaceProjectsBlock extends UIBlock { BundleEntry pu = iter.next(); // startsWith ensures that the test passes if the version is not entered in launchUrl - if (pu.getURL().startsWith(e.getURL())) { + if (pu.getArtifactUrl().url.startsWith(e.getArtifactUrl().url)) { iter.remove(); - rightSet.add(new BundleEntry(pu.getProjectName(), e.getURL(), e.getOptions())); - remainingProjects.removeURL(e.getURL()); + rightSet.add(new BundleEntry(pu.getProjectName(), e.getLaunchUrl(), e.getOptions())); + remainingProjects.removeURL(e.getArtifactUrl()); } } } diff --git a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/dialogs/AddEditUrlDialog.java b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/dialogs/AddEditUrlDialog.java index 1ddcc95ac571d72992ca004a50f1f121c0258343..332c2f18dbd7c59a0e26113ca1bc1df746a7e059 100644 --- a/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/dialogs/AddEditUrlDialog.java +++ b/uAALPaxTab/pax-runner-uaal/pax-runner-uaal-ui/src/main/java/org/universaal/uaalpax/ui/dialogs/AddEditUrlDialog.java @@ -37,6 +37,7 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; import org.universaal.uaalpax.model.BundleEntry; +import org.universaal.uaalpax.model.LaunchURL; public class AddEditUrlDialog extends Dialog { private final String title = "Add Bundle from URL"; @@ -49,23 +50,23 @@ public class AddEditUrlDialog extends Dialog { private String errorMessage; private IInputValidator validator; - private String url; + private LaunchURL url; private int level; public AddEditUrlDialog(Shell parentShell) { super(parentShell); - url = ""; + url = new LaunchURL(""); level = 10; } public AddEditUrlDialog(Shell parentShell, BundleEntry be) { super(parentShell); - url = be.getURL(); + url = be.getLaunchUrl(); level = be.getLevel(); } - public String getURL() { + public LaunchURL getURL() { return url; } @@ -98,7 +99,7 @@ public class AddEditUrlDialog extends Dialog { urlInput = new Text(composite, SWT.SINGLE | SWT.BORDER); urlInput.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL)); - urlInput.setText(url); + urlInput.setText(url.url); urlInput.addFocusListener(new FocusListener() { public void focusLost(FocusEvent e) { } @@ -175,7 +176,6 @@ public class AddEditUrlDialog extends Dialog { setErrorMessage(errorMessage); } - @Override protected void configureShell(Shell newShell) { super.configureShell(newShell); @@ -187,7 +187,7 @@ public class AddEditUrlDialog extends Dialog { */ protected void buttonPressed(int buttonId) { if (buttonId == IDialogConstants.OK_ID) { - url = urlInput.getText(); + url = new LaunchURL(urlInput.getText()); level = Integer.parseInt(levelInput.getText()); } else { url = null;