cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1423030 - in /cxf/branches/2.6.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
Date Mon, 17 Dec 2012 17:24:34 GMT
Author: sergeyb
Date: Mon Dec 17 17:24:33 2012
New Revision: 1423030

URL: http://svn.apache.org/viewvc?rev=1423030&view=rev
Log:
Merged revisions 1423026 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1423026 | sergeyb | 2012-12-17 17:22:08 +0000 (Mon, 17 Dec 2012) | 1 line
  
  [CXF-2704] Adding CXFNonSpringJaxrsServlet classloader property for extending classes to
set when needed
........

Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1423026

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.6.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java?rev=1423030&r1=1423029&r2=1423030&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
Mon Dec 17 17:24:33 2012
@@ -89,6 +89,7 @@ public class CXFNonSpringJaxrsServlet ex
     
     private static final String JAXRS_APPLICATION_PARAM = "javax.ws.rs.Application";
     
+    private ClassLoader classLoader;
     
     @Override
     public void init(ServletConfig servletConfig) throws ServletException {
@@ -456,17 +457,26 @@ public class CXFNonSpringJaxrsServlet ex
         bean.create();
     }
     
-    private Class<?> loadClass(String cName) throws ServletException {
+    protected Class<?> loadClass(String cName) throws ServletException {
         return loadClass(cName, "Resource");
     }
     
-    private Class<?> loadClass(String cName, String classType) throws ServletException
{
+    protected Class<?> loadClass(String cName, String classType) throws ServletException
{
         try {
-            return ClassLoaderUtils.loadClass(cName, CXFNonSpringJaxrsServlet.class);
+            
+            Class<?> cls = null;
+            if (classLoader == null) {
+                cls = ClassLoaderUtils.loadClass(cName, CXFNonSpringJaxrsServlet.class);
+            } else {
+                cls = classLoader.loadClass(cName); 
+            }
+            return cls;
         } catch (ClassNotFoundException ex) {
             throw new ServletException("No " + classType + " class " + cName.trim() + " can
be found", ex); 
         }
     }
     
-    
+    public void setClassLoader(ClassLoader loader) {
+        this.classLoader = loader;
+    }
 }



Mime
View raw message