felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r911735 - /felix/sandbox/rickhall/framework-proto/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
Date Fri, 19 Feb 2010 07:55:53 GMT
Author: rickhall
Date: Fri Feb 19 07:55:53 2010
New Revision: 911735

URL: http://svn.apache.org/viewvc?rev=911735&view=rev
Log:
Initial reexport visibility support.

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

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=911735&r1=911734&r2=911735&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
Fri Feb 19 07:55:53 2010
@@ -797,6 +797,23 @@
                     modulePkgMap,
                     candidateMap);
             }
+            for (Entry<String, List<Blame>> entry : candPkgs.m_requiredPkgs.entrySet())
+            {
+                List<Blame> blames = entry.getValue();
+                for (Blame blame : blames)
+                {
+                    if (blame.m_reqs.get(blame.m_reqs.size() - 1)
+                        .getDirective(Constants.VISIBILITY_DIRECTIVE) != null)
+                    {
+                        mergeCandidatePackage(
+                            current,
+                            true,
+                            new Blame(outgoingReqs, blame.m_cap),
+                            modulePkgMap,
+                            candidateMap);
+                    }
+                }
+            }
         }
     }
 
@@ -1217,7 +1234,8 @@
             }
             if (!rbReqs.isEmpty())
             {
-                Map<Requirement, Capability> rbMap = new HashMap<Requirement, Capability>();
+                Map<Requirement, List<Capability>> rbMap =
+                    new HashMap<Requirement, List<Capability>>();
 // TODO: FELIX3 - This approach isn't very efficient since it keeps recalculating the
 //       module wire for each package exported by the candidate module.
                 for (Entry<String, List<Blame>> entry : pkgs.m_requiredPkgs.entrySet())
@@ -1231,7 +1249,13 @@
                                 List<Capability> moduleCaps =
                                     Util.getCapabilityByNamespace(
                                         blame.m_cap.getModule(), Capability.MODULE_NAMESPACE);
-                                rbMap.put(rbReq, moduleCaps.get(0));
+                                List<Capability> caps = rbMap.get(rbReq);
+                                if (caps == null)
+                                {
+                                    caps = new ArrayList<Capability>();
+                                    rbMap.put(rbReq, caps);
+                                }
+                                caps.add(moduleCaps.get(0));
                                 if (!blame.m_cap.getModule().isResolved())
                                 {
                                     populateWireMap(
@@ -1247,16 +1271,22 @@
                 // correct order, which is required by the spec.
                 for (Requirement rbReq : rbReqs)
                 {
-                    Capability cap = rbMap.get(rbReq);
-                    // Ignore modules that import themselves.
-                    if ((cap != null) && !module.equals(cap.getModule()))
+                    List<Capability> caps = rbMap.get(rbReq);
+                    if (caps != null)
                     {
-                        moduleWires.add(
-                            new WireModuleImpl(module,
-                                rbReq,
-                                cap.getModule(),
-                                cap,
-                                pkgs.getRequiredPackages(cap.getModule())));
+                        for (Capability cap : caps)
+                        {
+                            // Ignore modules that import themselves.
+                            if (!module.equals(cap.getModule()))
+                            {
+                                moduleWires.add(
+                                    new WireModuleImpl(module,
+                                        rbReq,
+                                        cap.getModule(),
+                                        cap,
+                                        pkgs.getRequiredPackages(cap.getModule())));
+                            }
+                        }
                     }
                 }
             }



Mime
View raw message