felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r889437 [1/2] - in /felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver: CapabilityImpl.java Main.java Main2.java RequirementImpl.java cs/Capability.java manifestparser/Main.java prototype/ProtoResolver.java
Date Thu, 10 Dec 2009 21:59:29 GMT
Author: rickhall
Date: Thu Dec 10 21:59:28 2009
New Revision: 889437

URL: http://svn.apache.org/viewvc?rev=889437&view=rev
Log:
Start to pave the way for require-bundle support.

Modified:
    felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/CapabilityImpl.java
    felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/Main.java
    felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/Main2.java
    felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/RequirementImpl.java
    felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/cs/Capability.java
    felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/manifestparser/Main.java
    felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/prototype/ProtoResolver.java

Modified: felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/CapabilityImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/CapabilityImpl.java?rev=889437&r1=889436&r2=889437&view=diff
==============================================================================
--- felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/CapabilityImpl.java (original)
+++ felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/CapabilityImpl.java Thu Dec 10 21:59:28 2009
@@ -34,13 +34,12 @@
     private final List m_uses;
     private final Map<String, Attribute> m_attrs;
 
-    public CapabilityImpl(Module module, String namespace, String pkgName)
+    public CapabilityImpl(Module module, String namespace)
     {
         m_namespace = namespace;
         m_module = module;
         m_uses = new ArrayList<String>();
         m_attrs = new HashMap<String, Attribute>();
-        with("package=" + pkgName);
     }
 
     public Module getModule()
@@ -135,7 +134,6 @@
 
     public String toString()
     {
-        return "export " + getAttribute(Capability.PACKAGE_ATTR).getValue()
-            + " (" + getModule() + ")";
+        return m_namespace + "; " + m_attrs.values();
     }
 }
\ No newline at end of file

Modified: felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/Main.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/Main.java?rev=889437&r1=889436&r2=889437&view=diff
==============================================================================
--- felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/Main.java (original)
+++ felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/Main.java Thu Dec 10 21:59:28 2009
@@ -110,34 +110,34 @@
         // Bundle A
         moduleList.add(
             target = (m = new Module("A"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "bar"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "baz")));
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=bar"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=baz")));
         // Bundle B
         moduleList.add(
             (m = new Module("B"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "bar").using("woz"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "woz")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=bar").using("woz"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=woz")));
         // Bundle C
         moduleList.add(
             (m = new Module("C"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "woz").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=woz").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo")));
         // Bundle D
         moduleList.add(
             (m = new Module("D"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "woz"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "unused")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=woz"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=unused")));
         // Bundle E
         moduleList.add(
             (m = new Module("E"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "baz").using("dit"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "unused"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "dit")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=baz").using("dit"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=unused"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=dit")));
         // Bundle F
         moduleList.add(
             (m = new Module("F"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "dit").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=dit").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo")));
 
         return target;
     }
@@ -151,40 +151,40 @@
         // Bundle A
         moduleList.add(
             target = (m = new Module("A"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "bar"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "woz")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=bar"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=woz")));
         // Bundle B
         moduleList.add(
             (m = new Module("B"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "bar").using("baz,boo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "baz"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "boo")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=bar").using("baz,boo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=baz"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=boo")));
         // Bundle C
         moduleList.add(
             (m = new Module("C"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "woz").using("bar,dir"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "bar"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "dit")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=woz").using("bar,dir"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=bar"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=dit")));
         // Bundle D
         moduleList.add(
             (m = new Module("D"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "dit").using("dot"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "dot")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=dit").using("dot"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=dot")));
         // Bundle E
         moduleList.add(
             (m = new Module("E"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "dot").using("woz"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "woz")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=dot").using("woz"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=woz")));
         // Bundle F
         moduleList.add(
             (m = new Module("F"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "woz").using("bar"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "bar")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=woz").using("bar"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=bar")));
         // Bundle G
         moduleList.add(
             (m = new Module("G"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "dot")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=dot")));
 
         return target;
     }
@@ -198,24 +198,24 @@
         // Bundle A
         moduleList.add(
             target = (m = new Module("A"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "bar"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "baz")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=bar"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=baz")));
         // Bundle B
         moduleList.add(
             (m = new Module("B"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "bar").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "baz").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=bar").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=baz").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo")));
         // Bundle C
         moduleList.add(
             (m = new Module("C"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "bar").using("woz"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "woz")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=bar").using("woz"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=woz")));
         // Bundle D
         moduleList.add(
             (m = new Module("D"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "baz")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=baz")));
 
         return target;
     }
@@ -229,80 +229,80 @@
         // Bundle A
         moduleList.add(
             (m = new Module("A"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "bar").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=bar").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo")));
         // Bundle B
         moduleList.add(
             (m = new Module("B"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "a").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "b").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "c").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "d").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "e").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "f").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "g").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "h").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "i").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "j").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "k").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "l").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "m").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "n").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "o").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "p").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "q").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "r").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "s").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "t").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=a").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=b").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=c").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=d").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=e").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=f").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=g").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=h").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=i").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=j").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=k").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=l").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=m").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=n").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=o").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=p").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=q").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=r").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=s").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=t").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo")));
         // Bundle C
         moduleList.add(
             target = (m = new Module("C"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "a"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "b"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "c"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "d"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "e"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "f"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "g"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "h"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "i"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "j"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "k"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "l"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "m"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "n"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "o"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "p"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "q"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "r"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "s"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "t"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "foo"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "bar")));
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=a"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=b"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=c"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=d"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=e"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=f"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=g"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=h"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=i"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=j"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=k"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=l"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=m"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=n"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=o"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=p"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=q"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=r"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=s"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=t"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=foo"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=bar")));
         // Bundle D
         moduleList.add(
             (m = new Module("D"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "a"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "b"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "c"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "d"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "e"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "f"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "g"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "h"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "i"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "j"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "k"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "l"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "m"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "n"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "o"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "p"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "q"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "r"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "s"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "t")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=a"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=b"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=c"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=d"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=e"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=f"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=g"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=h"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=i"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=j"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=k"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=l"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=m"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=n"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=o"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=p"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=q"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=r"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=s"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=t")));
 
         return target;
     }
@@ -316,107 +316,107 @@
         // Bundle A
         moduleList.add(
             (m = new Module("A"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "bar").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=bar").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo")));
         // Bundle B
         moduleList.add(
             (m = new Module("B"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "a").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "b").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "c").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "d").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "e").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "f").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "g").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "h").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "i").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "j").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "k").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "l").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "m").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "n").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "o").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "p").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "q").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "r").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "s").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "t").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=a").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=b").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=c").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=d").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=e").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=f").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=g").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=h").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=i").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=j").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=k").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=l").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=m").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=n").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=o").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=p").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=q").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=r").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=s").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=t").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo")));
         // Bundle C
         moduleList.add(
             target = (m = new Module("C"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "a"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "b"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "c"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "d"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "e"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "f"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "g"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "h"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "i"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "j"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "k"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "l"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "m"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "n"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "o"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "p"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "q"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "r"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "s"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "t"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "foo"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "bar")));
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=a"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=b"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=c"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=d"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=e"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=f"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=g"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=h"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=i"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=j"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=k"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=l"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=m"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=n"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=o"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=p"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=q"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=r"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=s"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=t"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=foo"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=bar")));
         // Bundle D
         moduleList.add(
             (m = new Module("D"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "a"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "b")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=a"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=b")));
         // Bundle E
         moduleList.add(
             (m = new Module("E"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "c"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "d")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=c"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=d")));
         // Bundle F
         moduleList.add(
             (m = new Module("F"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "e"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "f")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=e"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=f")));
         // Bundle G
         moduleList.add(
             (m = new Module("G"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "g"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "h")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=g"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=h")));
         // Bundle H
         moduleList.add(
             (m = new Module("H"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "i"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "j")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=i"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=j")));
         // Bundle I
         moduleList.add(
             (m = new Module("I"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "k"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "l")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=k"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=l")));
         // Bundle J
         moduleList.add(
             (m = new Module("J"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "m"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "n")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=m"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=n")));
         // Bundle K
         moduleList.add(
             (m = new Module("K"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "o"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "p")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=o"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=p")));
         // Bundle L
         moduleList.add(
             (m = new Module("L"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "q"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "r")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=q"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=r")));
         // Bundle M
         moduleList.add(
             (m = new Module("M"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "s"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "t")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=s"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=t")));
 
         return target;
     }
@@ -430,22 +430,22 @@
         // Bundle A
         moduleList.add(
             target = (m = new Module("A"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "foo"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "bar"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "baz")
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=foo"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=bar"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=baz")
                     .with("attr=blah")));
 
         // Bundle B
         moduleList.add(
             (m = new Module("B"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo").using("bar"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "bar").using("baz"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "baz")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo").using("bar"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=bar").using("baz"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=baz")));
 
         // Bundle C
         moduleList.add(
             (m = new Module("C"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "baz")
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=baz")
                     .with("attr=blah")));
 
         return target;
@@ -462,18 +462,18 @@
         // Bundle A
         moduleList.add(
             target = (m = new Module("A"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "bar")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=bar")));
         // Bundle B
         moduleList.add(
             (m = new Module("B"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "bar"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "woz")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=bar"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=woz")));
         // Bundle C
         moduleList.add(
             (m = new Module("C"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "woz"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "foo")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=woz"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=foo")));
 
         return target;
     }
@@ -487,19 +487,19 @@
         // Bundle A
         moduleList.add(
             target = (m = new Module("A"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "bar"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "baz")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=bar"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=baz")));
         // Bundle B
         moduleList.add(
             (m = new Module("B"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "bar").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "baz")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=bar").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=baz")));
         // Bundle C
         moduleList.add(
             (m = new Module("C"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "bar")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=bar")));
 
         return target;
     }
@@ -513,26 +513,26 @@
         // Bundle A
         moduleList.add(
             (m = new Module("A"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foobar"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "bar").using("foo")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foobar"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=bar").using("foo")));
         // Bundle B
         moduleList.add(
             target = (m = new Module("B"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "foo"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "foobar"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "bar"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "baz")));
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=foo"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=foobar"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=bar"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=baz")));
         // Bundle C
         moduleList.add(
             (m = new Module("C"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "bar").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "baz").using("bar")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=bar").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=baz").using("bar")));
         // Bundle D
         moduleList.add(
             (m = new Module("D"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "bar")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=bar")));
 
         return target;
     }
@@ -546,15 +546,15 @@
         // Bundle A
         moduleList.add(
             (m = new Module("A"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo").withMandatory("vendor=foo")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo").withMandatory("vendor=foo")));
         // Bundle B
         moduleList.add(
             target = (m = new Module("B"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "foo")));
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=foo")));
         // Bundle C
         moduleList.add(
             (m = new Module("C"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo")));
 
         return target;
     }

Modified: felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/Main2.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/Main2.java?rev=889437&r1=889436&r2=889437&view=diff
==============================================================================
--- felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/Main2.java (original)
+++ felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/Main2.java Thu Dec 10 21:59:28 2009
@@ -115,40 +115,40 @@
         // Bundle A
         moduleList.add(
             (m = new Module("A"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "bar"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "baz")));
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=bar"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=baz")));
         targets.add(m);
         // Bundle B
         moduleList.add(
             (m = new Module("B"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "bar").using("woz"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "woz")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=bar").using("woz"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=woz")));
         // Bundle C
         moduleList.add(
             (m = new Module("C"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "woz").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=woz").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo")));
         // Bundle D
         moduleList.add(
             (m = new Module("D"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "woz"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "unused")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=woz"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=unused")));
         // Bundle E
         moduleList.add(
             (m = new Module("E"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "baz").using("dit"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "unused"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "dit")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=baz").using("dit"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=unused"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=dit")));
         // Bundle F
         moduleList.add(
             (m = new Module("F"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "dit").using("foo"))
-                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "foo")));
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=dit").using("foo"))
+                .providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=foo")));
         // Bundle G
         moduleList.add(
             (m = new Module("G"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "bar"))
-                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "woz")));
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=bar"))
+                .requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=woz")));
         targets.add(m);
 
         return targets;
@@ -164,8 +164,8 @@
 
         for (int i = 0; i < 1000; i++)
         {
-            m.providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "org.foo" + i));
-            m.requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE, "org.foo" + i));
+            m.providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=org.foo" + i));
+            m.requiring(new RequirementImpl(Capability.PACKAGE_NAMESPACE).with("package=org.foo" + i));
         }
 
         return targets;
@@ -181,7 +181,7 @@
 
         for (int i = 0; i < 1000; i++)
         {
-            m.providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE, "org.foo" + i));
+            m.providing(new CapabilityImpl(m, Capability.PACKAGE_NAMESPACE).with("package=org.foo" + i));
         }
 
         return targets;

Modified: felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/RequirementImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/RequirementImpl.java?rev=889437&r1=889436&r2=889437&view=diff
==============================================================================
--- felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/RequirementImpl.java (original)
+++ felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/RequirementImpl.java Thu Dec 10 21:59:28 2009
@@ -31,15 +31,14 @@
 public class RequirementImpl implements Requirement
 {
     private final String m_namespace;
-    private final String m_name;
+    private String m_name;
     private final Map<String, Attribute> m_attrs;
     private boolean m_optional = false;
     private SimpleFilter m_filter;
 
-    public RequirementImpl(String namespace, String name)
+    public RequirementImpl(String namespace)
     {
         m_namespace = namespace;
-        m_name = name;
         m_attrs = new HashMap<String, Attribute>();
         getFilter();
     }
@@ -90,6 +89,30 @@
             {
                 m_attrs.put(n, new Attribute(n, v, false));
             }
+
+            String targetName = null;
+            if (m_namespace.equals(Capability.MODULE_NAMESPACE))
+            {
+                if (n.equals(Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE))
+                {
+                    targetName = v;
+                }
+            }
+            else if (m_namespace.equals(Capability.PACKAGE_NAMESPACE))
+            {
+                if (n.equals(Capability.PACKAGE_ATTR))
+                {
+                    targetName = v;
+                }
+            }
+            else if (m_namespace.equals(Capability.HOST_NAMESPACE))
+            {
+                if (n.equals(Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE))
+                {
+                    targetName = v;
+                }
+            }
+            m_name = targetName;
         }
         m_filter = null;
         getFilter();
@@ -139,42 +162,17 @@
 
     public String toString()
     {
-        StringBuffer sb = new StringBuffer();
-        sb.append("import ");
-        sb.append(m_name);
-
-        if (m_attrs.size() > 0)
-        {
-            sb.append(" [");
-            for (Iterator<Entry<String, Attribute>> it = m_attrs.entrySet().iterator(); it.hasNext(); )
-            {
-                Entry<String, Attribute> entry = it.next();
-                sb.append(entry.getValue().getName());
-                sb.append('=');
-                sb.append(entry.getValue().getValue().toString());
-
-                if (it.hasNext())
-                {
-                    sb.append("; ");
-                }
-            }
-            sb.append("]");
-        }
-        return sb.toString();
+        return m_namespace + "; " + convertToFilter();
     }
 
     private String convertToFilter()
     {
         StringBuffer sb = new StringBuffer();
-        if ((m_attrs != null) && (m_attrs.size() > 0))
+        if ((m_attrs != null) && (m_attrs.size() > 1))
         {
             sb.append("(&");
         }
 
-        sb.append("(package=");
-        sb.append(m_name);
-        sb.append(")");
-
         for (Iterator<Entry<String, Attribute>> it = m_attrs.entrySet().iterator(); it.hasNext(); )
         {
             Entry<String, Attribute> entry = it.next();
@@ -228,7 +226,7 @@
             }
         }
 
-        if ((m_attrs != null) && (m_attrs.size() > 0))
+        if ((m_attrs != null) && (m_attrs.size() > 1))
         {
             sb.append(")");
         }

Modified: felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/cs/Capability.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/cs/Capability.java?rev=889437&r1=889436&r2=889437&view=diff
==============================================================================
--- felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/cs/Capability.java (original)
+++ felix/sandbox/rickhall/resolver/src/main/java/org/apache/felix/resolver/cs/Capability.java Thu Dec 10 21:59:28 2009
@@ -24,6 +24,7 @@
 public interface Capability
 {
     static final String MODULE_NAMESPACE = "module";
+    static final String HOST_NAMESPACE = "host";
     static final String PACKAGE_NAMESPACE = "package";
 
     public static final String PACKAGE_ATTR = "package";



Mime
View raw message