servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r414685 - /incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/XBeanServiceUnit.java
Date Thu, 15 Jun 2006 21:25:01 GMT
Author: gnodet
Date: Thu Jun 15 14:25:01 2006
New Revision: 414685

URL: http://svn.apache.org/viewvc?rev=414685&view=rev
Log:
Always return a valid class loader for the SU

Modified:
    incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/XBeanServiceUnit.java

Modified: incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/XBeanServiceUnit.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/XBeanServiceUnit.java?rev=414685&r1=414684&r2=414685&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/XBeanServiceUnit.java
(original)
+++ incubator/servicemix/trunk/servicemix-common/src/main/java/org/apache/servicemix/common/xbean/XBeanServiceUnit.java
Thu Jun 15 14:25:01 2006
@@ -61,13 +61,19 @@
     }
     
     public ClassLoader getConfigurationClassLoader() throws ServiceNotFoundException {
+        ClassLoader cl = null;
         if (kernel != null) {
             Object o = kernel.getServiceFactory(configuration);
             SpringConfigurationServiceFactory scsf = (SpringConfigurationServiceFactory)
o;
-            return scsf.getApplicationContext().getClassLoader();
-        } else {
-            return Thread.currentThread().getContextClassLoader();
+            cl = scsf.getApplicationContext().getClassLoader();
+        } 
+        if (cl == null) {
+            cl = Thread.currentThread().getContextClassLoader();
         }
+        if (cl == null) {
+            cl = getClass().getClassLoader();
+        }
+        return cl;
     }
     
 }



Mime
View raw message