felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r901281 - in /felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver: CandidateComparator.java Resolver.java ResolverImpl.java ResolverStateImpl.java StatefulResolver.java
Date Wed, 20 Jan 2010 17:06:23 GMT
Author: rickhall
Date: Wed Jan 20 17:06:22 2010
New Revision: 901281

URL: http://svn.apache.org/viewvc?rev=901281&view=rev
Log:
Fix many errors, but still completely broken.

Modified:
    felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/CandidateComparator.java
    felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/Resolver.java
    felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
    felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/ResolverStateImpl.java
    felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/StatefulResolver.java

Modified: felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/CandidateComparator.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/CandidateComparator.java?rev=901281&r1=901280&r2=901281&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/CandidateComparator.java
(original)
+++ felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/CandidateComparator.java
Wed Jan 20 17:06:22 2010
@@ -19,8 +19,9 @@
 package org.apache.felix.framework.resolver;
 
 import java.util.Comparator;
-import org.apache.felix.resolver.cs.Capability;
-import org.apache.felix.resolver.manifestparser.Constants;
+import org.apache.felix.framework.candidateset.Capability;
+import org.osgi.framework.Constants;
+import org.osgi.framework.Version;
 
 public class CandidateComparator implements Comparator
 {
@@ -85,7 +86,16 @@
         // Finally, compare module identity.
         if (c == 0)
         {
-            c = cap1.getModule().getName().compareTo(cap2.getModule().getName());
+            if (cap1.getModule().getBundle().getBundleId() <
+                cap2.getModule().getBundle().getBundleId())
+            {
+                c = -1;
+            }
+            else if (cap1.getModule().getBundle().getBundleId() >
+                cap2.getModule().getBundle().getBundleId())
+            {
+                c = 1;
+            }
         }
 
         return c;

Modified: felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/Resolver.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/Resolver.java?rev=901281&r1=901280&r2=901281&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/Resolver.java
(original)
+++ felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/Resolver.java
Wed Jan 20 17:06:22 2010
@@ -21,8 +21,10 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import org.apache.felix.resolver.cs.Capability;
-import org.apache.felix.resolver.cs.Requirement;
+import org.apache.felix.framework.candidateset.Capability;
+import org.apache.felix.framework.candidateset.Module;
+import org.apache.felix.framework.candidateset.Requirement;
+import org.apache.felix.framework.candidateset.Wire;
 
 public interface Resolver
 {

Modified: felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java?rev=901281&r1=901280&r2=901281&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
(original)
+++ felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
Wed Jan 20 17:06:22 2010
@@ -27,15 +27,11 @@
 import java.util.Map.Entry;
 import java.util.Set;
 import java.util.TreeSet;
-import org.apache.felix.resolver.CandidateComparator;
-import org.apache.felix.resolver.Module;
-import org.apache.felix.resolver.ResolveException;
-import org.apache.felix.resolver.Resolver;
-import org.apache.felix.resolver.ResolverStateImpl;
-import org.apache.felix.resolver.Wire;
-import org.apache.felix.resolver.cs.Capability;
-import org.apache.felix.resolver.cs.CapabilitySet;
-import org.apache.felix.resolver.cs.Requirement;
+import org.apache.felix.framework.candidateset.Capability;
+import org.apache.felix.framework.candidateset.CapabilitySet;
+import org.apache.felix.framework.candidateset.Module;
+import org.apache.felix.framework.candidateset.Requirement;
+import org.apache.felix.framework.candidateset.Wire;
 
 // 1. Treat hard pkg constraints separately from implied package constraints
 // 2. Map pkg constraints to a set of capabilities, not a single capability.
@@ -222,7 +218,7 @@
             if ((candidates.size() == 0) && !req.isOptional())
             {
                 throw new ResolveException("Unable to resolve " + module
-                    + ": missing requirement " + req);
+                    + ": missing requirement " + req, module, req);
             }
             else if (candidates.size() > 0)
             {
@@ -339,7 +335,7 @@
                         {
 //                            candidateMap.remove(req);
                             throw new ResolveException("Unresolved constraint "
-                                + req + " in " + module);
+                                + req + " in " + module, module, req);
                         }
                     }
                 }
@@ -484,7 +480,7 @@
             {
                 throw new ResolveException("Constraint violation between "
                     + current + " and " + candBlame.m_cap.getModule()
-                    + " for " + pkgName);
+                    + " for " + pkgName, null, null);
             }
 
             //
@@ -586,7 +582,7 @@
                     + " between existing constraint "
                     + currentUsedBlames.get(i)
                     + " and candidate constraint "
-                    + candBlame);
+                    + candBlame, null, null);
             }
         }
     }
@@ -678,7 +674,7 @@
                             + " between existing constraint "
                             + currentExportedBlame
                             + " and candidate constraint "
-                            + candSourceBlame);
+                            + candSourceBlame, null, null);
                     }
                     else if ((currentImportedBlame != null)
                         && !isCompatible(currentImportedBlame.m_cap, candSourceBlame.m_cap,
modulePkgMap))
@@ -712,7 +708,7 @@
                             + " between existing constraint "
                             + currentImportedBlame
                             + " and candidate constraint "
-                            + candSourceBlame);
+                            + candSourceBlame, null, null);
                     }
                 }
             }
@@ -833,7 +829,7 @@
                 if (!module.equals(entry.getValue().m_cap.getModule()))
                 {
                     moduleWires.add(
-                        new Wire(module,
+                        new WireImpl(module,
                             entry.getValue().m_reqs.get(entry.getValue().m_reqs.size() -
1),
                             entry.getValue().m_cap.getModule(),
                             entry.getValue().m_cap));
@@ -875,7 +871,7 @@
                         if (!module.equals(rbEntry.getValue().getModule()))
                         {
                             moduleWires.add(
-                                new Wire(module,
+                                new WireImpl(module,
                                     rbEntry.getKey(),
                                     rbEntry.getValue().getModule(),
                                     rbEntry.getValue()));

Modified: felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/ResolverStateImpl.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/ResolverStateImpl.java?rev=901281&r1=901280&r2=901281&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/ResolverStateImpl.java
(original)
+++ felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/ResolverStateImpl.java
Wed Jan 20 17:06:22 2010
@@ -22,11 +22,12 @@
 import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
-import org.apache.felix.resolver.Resolver.ResolverState;
-import org.apache.felix.resolver.cs.Capability;
-import org.apache.felix.resolver.cs.CapabilitySet;
-import org.apache.felix.resolver.cs.Requirement;
-import org.apache.felix.resolver.manifestparser.Constants;
+import org.apache.felix.framework.candidateset.Capability;
+import org.apache.felix.framework.candidateset.CapabilitySet;
+import org.apache.felix.framework.candidateset.Module;
+import org.apache.felix.framework.candidateset.Requirement;
+import org.apache.felix.framework.resolver.Resolver.ResolverState;
+import org.osgi.framework.Constants;
 
 public class ResolverStateImpl implements ResolverState
 {

Modified: felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/StatefulResolver.java
URL: http://svn.apache.org/viewvc/felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/StatefulResolver.java?rev=901281&r1=901280&r2=901281&view=diff
==============================================================================
--- felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/StatefulResolver.java
(original)
+++ felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/StatefulResolver.java
Wed Jan 20 17:06:22 2010
@@ -21,6 +21,9 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
+import org.apache.felix.framework.ModuleImpl;
+import org.apache.felix.framework.candidateset.Module;
+import org.apache.felix.framework.candidateset.Wire;
 
 public class StatefulResolver
 {
@@ -67,7 +70,7 @@
                 {
                     System.out.println("WIRE: " + wires.get(wireIdx));
                 }
-                entry.getKey().resolve(wires);
+                ((ModuleImpl) entry.getKey()).setWires(wires);
             }
         }
     }



Mime
View raw message