felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject svn commit: r1601009 - in /felix/trunk/framework/src/main/java/org/apache/felix/framework: ExtensionManager.java util/FelixConstants.java
Date Fri, 06 Jun 2014 20:50:32 GMT
Author: pauls
Date: Fri Jun  6 20:50:32 2014
New Revision: 1601009

URL: http://svn.apache.org/r1601009
Log:
Introduce a new property called felix.extensions.disable which (if set to true) disables framework
extensions. This might be necessary for now in some envs like e.g. javaws (FELIX-4281).

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
    felix/trunk/framework/src/main/java/org/apache/felix/framework/util/FelixConstants.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=1601009&r1=1601008&r2=1601009&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 Fri
Jun  6 20:50:32 2014
@@ -91,30 +91,38 @@ class ExtensionManager extends URLStream
     static
     {
         // pre-init the url sub-system as otherwise we don't work on gnu/classpath
-        ExtensionManager extensionManager = new ExtensionManager();
-        try
-        {
-            (new URL("http://felix.extensions:9/")).openConnection();
-        }
-        catch (Throwable t)
-        {
-            // This doesn't matter much - we only need the above to init the url subsystem
-        }
+        ExtensionManager extensionManager = null;
 
-        // We use the secure action of Felix to add a new instance to the parent
-        // classloader.
-        try
+        if (!"true".equalsIgnoreCase(Felix.m_secureAction.getSystemProperty(
+            FelixConstants.FELIX_EXTENSIONS_DISABLE, "false")))
         {
-            Felix.m_secureAction.addURLToURLClassLoader(Felix.m_secureAction.createURL(
-                Felix.m_secureAction.createURL(null, "http:", extensionManager),
-                "http://felix.extensions:9/", extensionManager),
-                Felix.class.getClassLoader());
-        }
-        catch (Throwable ex)
-        {
-            // extension bundles will not be supported.
-            extensionManager = null;
+            try
+            {
+                (new URL("http://felix.extensions:9/")).openConnection();
+            }
+            catch (Throwable t)
+            {
+                // This doesn't matter much - we only need the above to init the url subsystem
+            }
+
+            // We use the secure action of Felix to add a new instance to the parent
+            // classloader.
+            try
+            {
+                extensionManager = new ExtensionManager();
+
+                Felix.m_secureAction.addURLToURLClassLoader(Felix.m_secureAction.createURL(
+                    Felix.m_secureAction.createURL(null, "http:", extensionManager),
+                    "http://felix.extensions:9/", extensionManager),
+                    Felix.class.getClassLoader());
+            }
+            catch (Throwable ex)
+            {
+                // extension bundles will not be supported.
+                extensionManager = null;
+            }
         }
+
         m_extensionManager = extensionManager;
     }
 

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/util/FelixConstants.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/FelixConstants.java?rev=1601009&r1=1601008&r2=1601009&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/util/FelixConstants.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/util/FelixConstants.java
Fri Jun  6 20:50:32 2014
@@ -65,4 +65,5 @@ public interface FelixConstants extends 
     String FAKE_URL_PROTOCOL_VALUE = "location:";
     String FELIX_EXTENSION_ACTIVATOR = "Felix-Activator";
     String SECURITY_DEFAULT_POLICY = "felix.security.defaultpolicy";
+    String FELIX_EXTENSIONS_DISABLE = "felix.extensions.disable";
 }



Mime
View raw message