felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r944022 - in /felix/trunk/framework/src/main/java/org/apache/felix/framework: ExtensionManager.java Felix.java resolver/CandidateComparator.java resolver/ResolverImpl.java resolver/WireImpl.java
Date Thu, 13 May 2010 21:27:07 GMT
Author: rickhall
Date: Thu May 13 21:27:06 2010
New Revision: 944022

URL: http://svn.apache.org/viewvc?rev=944022&view=rev
Log:
More code cleanup. (FELIX-2035)

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
    felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
    felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/CandidateComparator.java
    felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
    felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/WireImpl.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java?rev=944022&r1=944021&r2=944022&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java Thu
May 13 21:27:06 2010
@@ -312,9 +312,6 @@ class ExtensionManager extends URLStream
 
         try
         {
-// TODO: EXTENSIONMANAGER - Should we be setting this?
-//            bundle.setExtension(true);
-
             // Merge the exported packages with the exported packages of the systembundle.
             List<Capability> exports = null;
             try
@@ -355,8 +352,6 @@ class ExtensionManager extends URLStream
         }
         catch (Exception ex)
         {
-// TODO: EXTENSIONMANAGER - Should we be setting this?
-//            bundle.setExtension(false);
             throw ex;
         }
 
@@ -380,11 +375,12 @@ class ExtensionManager extends URLStream
         {
             try
             {
+// TODO: SECURITY - Should this consider security?
                 BundleActivator activator = (BundleActivator)
                     felix.getClass().getClassLoader().loadClass(
                         activatorClass.trim()).newInstance();
 
-// TODO: KARL - This is kind of hacky, can we improve it?
+// TODO: EXTENSIONMANAGER - This is kind of hacky, can we improve it?
                 felix.m_activatorList.add(activator);
 
                 BundleContext context = felix._getBundleContext();

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java?rev=944022&r1=944021&r2=944022&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java Thu May 13 21:27:06
2010
@@ -2791,15 +2791,7 @@ ex.printStackTrace();
         // Acquire bundle lock.
         try
         {
-            if (bundle.isExtension())
-            {
-// TODO: EXTENSIONMANAGER - Verify this.
-                acquireBundleLock(bundle, Bundle.RESOLVED | Bundle.STARTING | Bundle.ACTIVE);
-            }
-            else
-            {
-                acquireBundleLock(bundle, Bundle.STARTING | Bundle.ACTIVE);
-            }
+            acquireBundleLock(bundle, Bundle.STARTING | Bundle.ACTIVE);
         }
         catch (IllegalStateException ex)
         {

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/CandidateComparator.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/CandidateComparator.java?rev=944022&r1=944021&r2=944022&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/CandidateComparator.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/CandidateComparator.java
Thu May 13 21:27:06 2010
@@ -43,7 +43,7 @@ public class CandidateComparator impleme
             c = 1;
         }
 
-        // Next compare version numbers.
+        // Compare module capabilities.
         if ((c == 0) && cap1.getNamespace().equals(Capability.MODULE_NAMESPACE))
         {
             c = ((Comparable) cap1.getAttribute(Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE)
@@ -62,10 +62,8 @@ public class CandidateComparator impleme
                 c = v2.compareTo(v1);
             }
         }
-// TODO: FELIX3 - Need to change this to handle arbitrary capabilities
-//       that may not have a natural ordering.
-        // Assume everything else is a package capability.
-        else if (c == 0)
+        // Compare package capabilities.
+        else if ((c == 0) && cap1.getNamespace().equals(Capability.PACKAGE_NAMESPACE))
         {
             c = ((Comparable) cap1.getAttribute(Capability.PACKAGE_ATTR).getValue())
                 .compareTo(cap2.getAttribute(Capability.PACKAGE_ATTR).getValue());

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java?rev=944022&r1=944021&r2=944022&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/ResolverImpl.java
Thu May 13 21:27:06 2010
@@ -232,7 +232,8 @@ public class ResolverImpl implements Res
         return null;
     }
 
-// TODO: FELIX3 - It would be nice to make this private.
+// TODO: FELIX3 - It would be nice to make this private. We will likely have
+//       to duplicate some of its code if we put the resolve in a separate module.
     public static Map<Requirement, Set<Capability>> getDynamicImportCandidates(
         ResolverState state, Module module, String pkgName)
     {
@@ -530,9 +531,6 @@ public class ResolverImpl implements Res
             }
         }
 
-// TODO: FELIX3 - Since we reuse the same dynamic requirement, is it possible
-//       that some sort of cycle could cause us to try to match another set
-//       of candidates to the same requirement?
         if (candidates.size() == 0)
         {
             candidateMap.remove(dynReq);
@@ -707,7 +705,7 @@ public class ResolverImpl implements Res
             // We have to merge all exported packages from the candidate,
             // since the current module requires it.
 // TODO: FELIX3 - If a module imports its exports, then imported exports should
-//       should be reexported to requiring bundle.
+//       be reexported to requiring bundles.
             for (Entry<String, Blame> entry : candPkgs.m_exportedPkgs.entrySet())
             {
                 mergeCandidatePackage(
@@ -1010,8 +1008,7 @@ public class ResolverImpl implements Res
                     mutated = (mutated != null)
                         ? mutated
                         : new HashSet();
-// TODO: FELIX3 - I think we need to walk up this chain too.
-// TODO: FELIX3 - What about uses and import permutations?
+// TODO: FELIX3 - I think we need to walk up the uses chain too.
                     Requirement req = blame.m_reqs.get(blame.m_reqs.size() - 1);
                     if (!mutated.contains(req))
                     {

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/WireImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/WireImpl.java?rev=944022&r1=944021&r2=944022&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/WireImpl.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/resolver/WireImpl.java
Thu May 13 21:27:06 2010
@@ -94,7 +94,6 @@ public class WireImpl implements Wire
             // to the exporting module, rather than its content, so it can
             // it can follow any internal wires it may have (e.g., if the
             // package has multiple sources).
-// TODO: FELIX3 - Should isIncluded() be part of Capability?
             if (((CapabilityImpl) m_cap).isIncluded(name))
             {
                 clazz = m_exporter.getClassByDelegation(name);



Mime
View raw message