cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r665722 - /cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java
Date Mon, 09 Jun 2008 15:32:41 GMT
Author: sergeyb
Date: Mon Jun  9 08:32:41 2008
New Revision: 665722

URL: http://svn.apache.org/viewvc?rev=665722&view=rev
Log:
Updating BusFactory to use ClassLoaderUtils instead of Class.forName()

Modified:
    cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java

Modified: cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java?rev=665722&r1=665721&r2=665722&view=diff
==============================================================================
--- cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java (original)
+++ cxf/branches/2.0.x-fixes/api/src/main/java/org/apache/cxf/BusFactory.java Mon Jun  9 08:32:41
2008
@@ -26,6 +26,7 @@
 import java.util.logging.Logger;
 
 import org.apache.cxf.buslifecycle.BusLifeCycleManager;
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.logging.LogUtils;
 
 public abstract class BusFactory {
@@ -146,6 +147,7 @@
      * default search algorithm.
      * @return a new BusFactory to be used to create Bus objects
      */
+    @SuppressWarnings("unchecked")
     public static BusFactory newInstance(String className) {
         BusFactory instance = null;
         ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
@@ -154,7 +156,8 @@
         }
         Class<? extends BusFactory> busFactoryClass;
         try {
-            busFactoryClass = Class.forName(className, true, classLoader).asSubclass(BusFactory.class);
+            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);



Mime
View raw message