felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r469621 - in /incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework: Felix.java StartLevelImpl.java
Date Tue, 31 Oct 2006 19:39:04 GMT
Author: rickhall
Date: Tue Oct 31 11:39:03 2006
New Revision: 469621

URL: http://svn.apache.org/viewvc?view=rev&rev=469621
Log:
Applied patch (FELIX-168) for fine-grained spec compliance with start level
service.

Modified:
    incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
    incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/StartLevelImpl.java

Modified: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java?view=diff&rev=469621&r1=469620&r2=469621
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java (original)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java Tue
Oct 31 11:39:03 2006
@@ -474,17 +474,19 @@
         // Set the start level using the start level service;
         // this ensures that all start level requests are
         // serialized.
-        // NOTE: There is potentially a specification compliance
-        // issue here, since the start level request is asynchronous;
-        // this means that the framework will fire its STARTED event
-        // before all bundles have officially been restarted and it
-        // is not clear if this is really an issue or not.
         try
         {
             StartLevel sl = (StartLevel) getService(
                 getBundle(0),
                 getServiceReferences((BundleImpl) getBundle(0), StartLevel.class.getName(),
null)[0]);
-            sl.setStartLevel(startLevel);
+            if (sl instanceof StartLevelImpl)
+            {
+                ((StartLevelImpl) sl).setStartLevelAndWait(startLevel);
+            }
+            else
+            {
+                sl.setStartLevel(startLevel);
+            }
         }
         catch (InvalidSyntaxException ex)
         {
@@ -805,7 +807,10 @@
             }
         }
 
-        fireFrameworkEvent(FrameworkEvent.STARTLEVEL_CHANGED, getBundle(0), null);
+        if (m_frameworkStatus == RUNNING_STATUS)
+        {
+            fireFrameworkEvent(FrameworkEvent.STARTLEVEL_CHANGED, getBundle(0), null);
+        }
     }
 
     /**

Modified: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/StartLevelImpl.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/StartLevelImpl.java?view=diff&rev=469621&r1=469620&r2=469621
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/StartLevelImpl.java
(original)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/StartLevelImpl.java
Tue Oct 31 11:39:03 2006
@@ -86,7 +86,8 @@
     }
 
     /**
-     * This method is currently only called by the shutdown thread when the
+     * This method is currently only called by the by the thread that calls
+     * the Felix.start() method and the shutdown thread when the
      * framework is shutting down.
      * @param startlevel
     **/



Mime
View raw message