Return-Path: X-Original-To: apmail-felix-commits-archive@www.apache.org Delivered-To: apmail-felix-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7072F11949 for ; Fri, 6 Jun 2014 20:50:54 +0000 (UTC) Received: (qmail 66940 invoked by uid 500); 6 Jun 2014 20:50:54 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 66896 invoked by uid 500); 6 Jun 2014 20:50:54 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 66889 invoked by uid 99); 6 Jun 2014 20:50:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jun 2014 20:50:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jun 2014 20:50:52 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DEEA3238890D; Fri, 6 Jun 2014 20:50:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@felix.apache.org From: pauls@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140606205032.DEEA3238890D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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"; }