felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r758720 - /felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
Date Thu, 26 Mar 2009 16:25:44 GMT
Author: rickhall
Date: Thu Mar 26 16:25:32 2009
New Revision: 758720

URL: http://svn.apache.org/viewvc?rev=758720&view=rev
Log:
Applied patch (FELIX-999) to avoid starting fragment bundles.

Modified:
    felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java

Modified: felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java?rev=758720&r1=758719&r2=758720&view=diff
==============================================================================
--- felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
(original)
+++ felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/ResolverImpl.java
Thu Mar 26 16:25:32 2009
@@ -496,7 +496,11 @@
                         // started later.
                         if (doStartBundle)
                         {
-                            startList.add(localResource.getBundle());
+                            Bundle bundle = localResource.getBundle();
+                            if (!isFragmentBundle(bundle)) 
+                            {
+                                startList.add(bundle);
+                            }
                         }
                     }
                     catch (Exception ex)
@@ -531,7 +535,10 @@
                         // started later.
                         if (start)
                         {
-                            startList.add(bundle);
+                            if (!isFragmentBundle(bundle)) 
+                            {
+                                startList.add(bundle);    
+                            }
                         }
                     }
                 }
@@ -562,6 +569,17 @@
         }
     }
 
+    /**
+     * Determines if the given bundle is a fragement bundle.
+     * 
+     * @param bundle bundle to check
+     * @return flag indicating if the given bundle is a fragement
+     */
+    private boolean isFragmentBundle(Bundle bundle) 
+    {
+        return bundle.getHeaders().get(Constants.FRAGMENT_HOST) != null;
+    }
+    
     private void addReason(Resource resource, Requirement req)
     {
         Requirement[] reasons = (Requirement[]) m_reasonMap.get(resource);



Mime
View raw message