cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r691602 - in /cxf/trunk: api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
Date Wed, 03 Sep 2008 13:07:28 GMT
Author: sergeyb
Date: Wed Sep  3 06:07:27 2008
New Revision: 691602

URL: http://svn.apache.org/viewvc?rev=691602&view=rev
Log:
Updating JaxbExtensionHelper to use ClassLoaderUtils instead of Class.forName

Modified:
    cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
    cxf/trunk/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java

Modified: cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java?rev=691602&r1=691601&r2=691602&view=diff
==============================================================================
--- cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java (original)
+++ cxf/trunk/api/src/main/java/org/apache/cxf/wsdl/JAXBExtensionHelper.java Wed Sep  3 06:07:27
2008
@@ -48,6 +48,7 @@
 
 import org.w3c.dom.Element;
 
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.common.util.StringUtils;
@@ -77,12 +78,13 @@
         jaxbNamespace = ns;
     }
     
-    public static void addExtensions(ExtensionRegistry registry, String parentType, String
elementType,
-                                     ClassLoader cl) throws JAXBException, ClassNotFoundException
{
-        Class<?> parentTypeClass = Class.forName(parentType, true, cl);
-
-        Class<? extends TExtensibilityElementImpl> elementTypeClass = Class.forName(elementType,
true, cl)
-            .asSubclass(TExtensibilityElementImpl.class);
+    public static void addExtensions(ExtensionRegistry registry, String parentType, String
elementType)
+        throws JAXBException, ClassNotFoundException {
+        Class<?> parentTypeClass = ClassLoaderUtils.loadClass(parentType, JAXBExtensionHelper.class);
+
+        Class<? extends TExtensibilityElementImpl> elementTypeClass = 
+            ClassLoaderUtils.loadClass(elementType, JAXBExtensionHelper.class)
+                .asSubclass(TExtensibilityElementImpl.class);
         addExtensions(registry, parentTypeClass, elementTypeClass, null);
     }
     

Modified: cxf/trunk/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java?rev=691602&r1=691601&r2=691602&view=diff
==============================================================================
--- cxf/trunk/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java (original)
+++ cxf/trunk/api/src/test/java/org/apache/cxf/wsdl/JAXBExtensionHelperTest.java Wed Sep 
3 06:07:27 2008
@@ -66,16 +66,13 @@
     public void testAddTestExtension() throws Exception {
 
         JAXBExtensionHelper.addExtensions(registry, "javax.wsdl.Port",
-                        "org.apache.cxf.abc.test.TestPolicyType", Thread.currentThread()
-                                        .getContextClassLoader());
+                        "org.apache.cxf.abc.test.TestPolicyType");
 
         JAXBExtensionHelper.addExtensions(registry, "javax.wsdl.Port",
-                        "org.apache.cxf.abc.test.AnotherPolicyType", Thread.currentThread()
-                                        .getContextClassLoader());
+                        "org.apache.cxf.abc.test.AnotherPolicyType");
 
         JAXBExtensionHelper.addExtensions(registry, "javax.wsdl.Definition",
-                        "org.apache.cxf.abc.test.NewServiceType", Thread.currentThread()
-                                        .getContextClassLoader());
+                        "org.apache.cxf.abc.test.NewServiceType");
 
         String file = this.getClass().getResource("/wsdl/test_ext.wsdl").toURI().toString();
 
@@ -109,8 +106,7 @@
     @Test
     public void testPrettyPrintXMLStreamWriter() throws Exception {
         JAXBExtensionHelper.addExtensions(registry, "javax.wsdl.Definition",
-                        "org.apache.cxf.abc.test.NewServiceType", Thread.currentThread()
-                                        .getContextClassLoader());
+                        "org.apache.cxf.abc.test.NewServiceType");
 
         String file = this.getClass().getResource("/wsdl/test_ext.wsdl").toURI().toString();
 

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java?rev=691602&r1=691601&r2=691602&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLManagerImpl.java Wed Sep  3
06:07:27 2008
@@ -238,9 +238,7 @@
                 if (LOG.isLoggable(Level.FINE)) {
                     LOG.fine("Registering extension: " + elementType + " for parent: " +
parentType);
                 }
-                JAXBExtensionHelper.addExtensions(registry, parentType, elementType, 
-                                                  Thread.currentThread()
-                                                      .getContextClassLoader());
+                JAXBExtensionHelper.addExtensions(registry, parentType, elementType);
             } catch (ClassNotFoundException ex) {
                 LOG.log(Level.WARNING, "EXTENSION_ADD_FAILED_MSG", ex);
             } catch (JAXBException ex) {



Mime
View raw message