You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2011/02/09 23:44:23 UTC

svn commit: r1069153 - in /felix/trunk/framework/src/main/java/org/apache/felix/framework: BundleImpl.java Felix.java

Author: rickhall
Date: Wed Feb  9 22:44:22 2011
New Revision: 1069153

URL: http://svn.apache.org/viewvc?rev=1069153&view=rev
Log:
When the framework is stopped, the system bundle (i.e., the framework)
should stay in the RESOVLED state, unlike normal bundles that become
UNRESOLVED and thrown away. To achieve this, Felix should overload
BundleImpl.close() to do nothing. (FELIX-2822)

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

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java?rev=1069153&r1=1069152&r2=1069153&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java Wed Feb  9 22:44:22 2011
@@ -97,20 +97,16 @@ class BundleImpl implements Bundle
     synchronized void close()
     {
         closeModules();
-        // System bundle has no archive associated with it.
-        if (m_archive != null)
+        try
         {
-            try
-            {
-                m_archive.close();
-            }
-            catch (Exception ex)
-            {
-                getFramework().getLogger().log(
-                    this,
-                    Logger.LOG_ERROR,
-                    "Unable to close archive revisions.", ex);
-            }
+            m_archive.close();
+        }
+        catch (Exception ex)
+        {
+            getFramework().getLogger().log(
+                this,
+                Logger.LOG_ERROR,
+                "Unable to close archive revisions.", ex);
         }
     }
 

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=1069153&r1=1069152&r2=1069153&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 Wed Feb  9 22:44:22 2011
@@ -83,7 +83,7 @@ public class Felix extends BundleImpl im
     static final SecureAction m_secureAction = new SecureAction();
 
     // The extension manager to handle extension bundles
-    ExtensionManager m_extensionManager;
+    private final ExtensionManager m_extensionManager;
 
     // Logging related member variables.
     private final Logger m_logger;
@@ -439,6 +439,13 @@ public class Felix extends BundleImpl im
         return result;
     }
 
+    // This overrides BundleImpl.close() which avoids removing the
+    // system bundle module from the resolver state.
+    @Override
+    void close()
+    {
+    }
+
     // This overrides the default behavior of BundleImpl.getFramework()
     // to return "this", since the system bundle is the framework.
     Felix getFramework()