felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r900959 - in /felix/trunk/framework/src/main/java/org/apache/felix/framework: Felix.java ModuleImpl.java util/FelixConstants.java
Date Tue, 19 Jan 2010 21:12:21 GMT
Author: rickhall
Date: Tue Jan 19 21:12:20 2010
New Revision: 900959

URL: http://svn.apache.org/viewvc?rev=900959&view=rev
Log:
Applied patch (FELIX-1991) to make boot delegation class loader configurable.

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java
    felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.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/Felix.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/Felix.java?rev=900959&r1=900958&r2=900959&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 Tue Jan 19 21:12:20
2010
@@ -3687,7 +3687,15 @@
         {
             sb.setCharAt(sb.toString().indexOf("-"), '.');
         }
-        return sb.toString();
+        String toRet = sb.toString();
+        if (toRet.contains("${pom"))
+        {
+            return "0.0.0";
+        }
+        else
+        {
+            return toRet;
+        }
     }
 
     //

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java?rev=900959&r1=900958&r2=900959&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java Tue Jan
19 21:12:20 2010
@@ -99,9 +99,13 @@
     private boolean m_isActivationTriggered = false;
     private ProtectionDomain m_protectionDomain = null;
     private static SecureAction m_secureAction = new SecureAction();
-    // Class load to be used for boot delegation.
-    private final static ClassLoader m_bootClassLoader;
-    // Statically create the class loader for boot delegation.
+
+    // Bundle-specific class loader for boot delegation.
+    private final ClassLoader m_bootClassLoader;
+    // Default class loader for boot delegation.
+    private final static ClassLoader m_defBootClassLoader;
+
+    // Statically define the default class loader for boot delegation.
     static
     {
         ClassLoader cl = null;
@@ -120,7 +124,7 @@
             cl = null;
             System.err.println("Problem creating boot delegation class loader: " + ex);
         }
-        m_bootClassLoader = cl;
+        m_defBootClassLoader = cl;
     }
 
     // Boot delegation packages.
@@ -175,6 +179,7 @@
         m_activationExcludes = null;
         m_activationIncludes = null;
         m_implicitBootDelegation = false;
+        m_bootClassLoader = m_defBootClassLoader;
     }
 
     public ModuleImpl(
@@ -201,6 +206,18 @@
                 (String) m_configMap.get(
                     FelixConstants.IMPLICIT_BOOT_DELEGATION_PROP)).booleanValue();
 
+        ClassLoader bootLoader = m_defBootClassLoader;
+        Object map = m_configMap.get(FelixConstants.BOOT_CLASSLOADERS_PROP);
+        if (map instanceof Map)
+        {
+            Object l = ((Map) map).get(bundle);
+            if (l instanceof ClassLoader)
+            {
+                bootLoader = (ClassLoader) l;
+            }
+        }
+        m_bootClassLoader = bootLoader;
+
         ManifestParser mp = new ManifestParser(m_logger, m_configMap, this, m_headerMap);
 
         // Record some of the parsed metadata. Note, if this is an extension
@@ -1539,6 +1556,13 @@
 
     private boolean shouldBootDelegate(String pkgName)
     {
+        // Always boot delegate if the bundle has a configured
+        // boot class loader.
+        if (m_classLoader != m_defBootClassLoader)
+        {
+            return true;
+        }
+
         boolean result = false;
 
         // Only consider delegation if we have a package name, since

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=900959&r1=900958&r2=900959&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
Tue Jan 19 21:12:20 2010
@@ -52,6 +52,7 @@
         = "felix.startlevel.bundle";
     public static final String SERVICE_URLHANDLERS_PROP = "felix.service.urlhandlers";
     public static final String IMPLICIT_BOOT_DELEGATION_PROP = "felix.bootdelegation.implicit";
+    public static final String BOOT_CLASSLOADERS_PROP = "felix.bootdelegation.classloaders";
 
     // Start level-related constants.
     public static final int FRAMEWORK_INACTIVE_STARTLEVEL = 0;



Mime
View raw message