Author: dkulp
Date: Mon Apr 11 10:16:42 2011
New Revision: 1091006
URL: http://svn.apache.org/viewvc?rev=1091006&view=rev
Log:
Use classloader of the BusFactory when determining if the conditions are
met since that's the classloader that will matter.
Modified:
cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java
cxf/trunk/rt/core/src/main/resources/META-INF/services/org.apache.cxf.bus.factory
Modified: cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java
URL:
http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java?rev=1091006&r1=1091005&r2=1091006&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/BusFactory.java Mon Apr 11
10:16:42 2011
@@ -235,6 +235,7 @@ public abstract class BusFactory {
try {
busFactoryClass = ClassLoaderUtils.loadClass(className,
BusFactory.class)
.asSubclass(BusFactory.class);
+
instance = busFactoryClass.newInstance();
} catch (Exception ex) {
LogUtils.log(LOG, Level.SEVERE, "BUS_FACTORY_INSTANTIATION_EXC",
ex);
@@ -294,7 +295,15 @@ public abstract class BusFactory {
if (isValidBusFactoryClass(busFactoryClass)) {
if (busFactoryCondition != null) {
try {
- classLoader.loadClass(busFactoryCondition);
+ Class<?> cls =
ClassLoaderUtils.loadClass(busFactoryClass, BusFactory.class)
+ .asSubclass(BusFactory.class);
+ int idx = busFactoryCondition.indexOf(',');
+ while (idx != -1) {
+
cls.getClassLoader().loadClass(busFactoryCondition.substring(0, idx));
+ busFactoryCondition =
busFactoryCondition.substring(idx + 1);
+ idx = busFactoryCondition.indexOf(',');
+ }
+ cls.getClassLoader().loadClass(busFactoryCondition);
return busFactoryClass;
} catch (ClassNotFoundException e) {
return DEFAULT_BUS_FACTORY;
Modified:
cxf/trunk/rt/core/src/main/resources/META-INF/services/org.apache.cxf.bus.factory
URL:
http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/resources/META-INF/services/org.apache.cxf.bus.factory?rev=1091006&r1=1091005&r2=1091006&view=diff
==============================================================================
---
cxf/trunk/rt/core/src/main/resources/META-INF/services/org.apache.cxf.bus.factory
(original)
+++
cxf/trunk/rt/core/src/main/resources/META-INF/services/org.apache.cxf.bus.factory
Mon Apr 11 10:16:42 2011
@@ -1,2 +1,2 @@
org.apache.cxf.bus.spring.SpringBusFactory
-org.springframework.context.ApplicationContext
\ No newline at end of file
+org.springframework.context.ApplicationContext,org.springframework.beans.BeansException
\ No newline at end of file