incubator-aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cummi...@apache.org
Subject svn commit: r1053144 - in /incubator/aries/trunk/application: application-runtime-framework-management/src/main/java/org/apache/aries/application/runtime/framework/management/ application-runtime-framework/src/main/java/org/apache/aries/application/run...
Date Mon, 27 Dec 2010 19:09:42 GMT
Author: cumminsh
Date: Mon Dec 27 19:09:42 2010
New Revision: 1053144

URL: http://svn.apache.org/viewvc?rev=1053144&view=rev
Log:
ARIES-518: Tweaks to composite bundle start sequence.

Modified:
    incubator/aries/trunk/application/application-runtime-framework-management/src/main/java/org/apache/aries/application/runtime/framework/management/BundleFrameworkManagerImpl.java
    incubator/aries/trunk/application/application-runtime-framework/src/main/java/org/apache/aries/application/runtime/framework/BundleFrameworkImpl.java

Modified: incubator/aries/trunk/application/application-runtime-framework-management/src/main/java/org/apache/aries/application/runtime/framework/management/BundleFrameworkManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-runtime-framework-management/src/main/java/org/apache/aries/application/runtime/framework/management/BundleFrameworkManagerImpl.java?rev=1053144&r1=1053143&r2=1053144&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-runtime-framework-management/src/main/java/org/apache/aries/application/runtime/framework/management/BundleFrameworkManagerImpl.java
(original)
+++ incubator/aries/trunk/application/application-runtime-framework-management/src/main/java/org/apache/aries/application/runtime/framework/management/BundleFrameworkManagerImpl.java
Mon Dec 27 19:09:42 2010
@@ -159,8 +159,14 @@ public class BundleFrameworkManagerImpl 
     // We should now have a bundleFramework
     if (bundleFramework != null) {
 
-       // Start the empty framework (but not the bundle)
-       bundleFramework.init();
+      boolean frameworkStarted = false;
+      try {
+        // Start the empty framework bundle
+        bundleFramework.start();
+        frameworkStarted = true;
+      } catch (BundleException e) {
+        // This may fail if the framework bundle has exports but we will retry later
+      }
 
       /**
        * Install the bundles into the new framework
@@ -174,7 +180,8 @@ public class BundleFrameworkManagerImpl 
       }
       
       // Finally, start the whole lot
-      bundleFramework.start();
+      if (!frameworkStarted)
+        bundleFramework.start();
     }
 
     LOGGER.debug(LOG_EXIT, "isolatedInstall", bundleFramework);
@@ -307,3 +314,4 @@ public class BundleFrameworkManagerImpl 
   }
 
 }
+

Modified: incubator/aries/trunk/application/application-runtime-framework/src/main/java/org/apache/aries/application/runtime/framework/BundleFrameworkImpl.java
URL: http://svn.apache.org/viewvc/incubator/aries/trunk/application/application-runtime-framework/src/main/java/org/apache/aries/application/runtime/framework/BundleFrameworkImpl.java?rev=1053144&r1=1053143&r2=1053144&view=diff
==============================================================================
--- incubator/aries/trunk/application/application-runtime-framework/src/main/java/org/apache/aries/application/runtime/framework/BundleFrameworkImpl.java
(original)
+++ incubator/aries/trunk/application/application-runtime-framework/src/main/java/org/apache/aries/application/runtime/framework/BundleFrameworkImpl.java
Mon Dec 27 19:09:42 2010
@@ -56,20 +56,27 @@ public class BundleFrameworkImpl impleme
   @Override
   public void init() throws BundleException
   {
-    if (_compositeBundle.getCompositeFramework().getState() != Framework.ACTIVE)
-    {
-    	_compositeBundle.getCompositeFramework().start();
-        _packageAdminTracker = new ServiceTracker(_compositeBundle.getCompositeFramework().getBundleContext(),
-                PackageAdmin.class.getName(), null);
-          _packageAdminTracker.open();
-   }
+        _compositeBundle.start(Bundle.START_ACTIVATION_POLICY);
+  if ( _packageAdminTracker == null)
+  {
+      _packageAdminTracker = new ServiceTracker(_compositeBundle.getCompositeFramework().getBundleContext(),
+          PackageAdmin.class.getName(), null);
+      _packageAdminTracker.open();
   }
-
+    
+  }
+  
   @Override
   public void start() throws BundleException
   {
-	  init();
-    _compositeBundle.start(Bundle.START_ACTIVATION_POLICY);
+    if (_compositeBundle.getCompositeFramework().getState() != Framework.ACTIVE)
+    {
+      _compositeBundle.getCompositeFramework().start();
+  
+      _packageAdminTracker = new ServiceTracker(_compositeBundle.getCompositeFramework().getBundleContext(),
+          PackageAdmin.class.getName(), null);
+      _packageAdminTracker.open();
+    }
   }
 
   public void close() throws BundleException
@@ -158,3 +165,4 @@ public class BundleFrameworkImpl impleme
     _bundles.remove(b);
   }
 }
+



Mime
View raw message