cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1519647 - /cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
Date Tue, 03 Sep 2013 11:19:15 GMT
Author: sergeyb
Date: Tue Sep  3 11:19:15 2013
New Revision: 1519647

URL: http://svn.apache.org/r1519647
Log:
Minor updates to CXFNonSpringJaxrsServlet to make it simpler to override methods creating
Application

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java?rev=1519647&r1=1519646&r2=1519647&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
Tue Sep  3 11:19:15 2013
@@ -88,14 +88,13 @@ public class CXFNonSpringJaxrsServlet ex
     public void init(ServletConfig servletConfig) throws ServletException {
         super.init(servletConfig);
         
-        String splitChar = getParameterSplitChar(servletConfig);
-                
         String applicationClass = servletConfig.getInitParameter(JAXRS_APPLICATION_PARAM);
         if (applicationClass != null) {
-            createServerFromApplication(applicationClass, servletConfig, splitChar);
+            createServerFromApplication(applicationClass, servletConfig);
             return;
         }
         
+        String splitChar = getParameterSplitChar(servletConfig);
         JAXRSServerFactoryBean bean = new JAXRSServerFactoryBean();
         bean.setBus(getBus());
         
@@ -428,18 +427,18 @@ public class CXFNonSpringJaxrsServlet ex
         
     }
     
-    protected void createServerFromApplication(String cName, ServletConfig servletConfig,
-                                               String splitChar) 
+    protected void createServerFromApplication(String cName, ServletConfig servletConfig)

         throws ServletException {
         Map<String, List<String>> props = new HashMap<String, List<String>>();
         cName = getClassNameAndProperties(cName, props);
-        Class<?> appClass = loadClass(cName, "Application");
+        Class<?> appClass = loadApplicationClass(cName);
         Application app = (Application)createSingletonInstance(appClass, props, servletConfig);
         
         String ignoreParam = servletConfig.getInitParameter(IGNORE_APP_PATH_PARAM);
         JAXRSServerFactoryBean bean = ResourceUtils.createApplication(app, 
                                             MessageUtils.isTrue(ignoreParam),
                                             getStaticSubResolutionValue(servletConfig));
+        String splitChar = getParameterSplitChar(servletConfig);
         setAllInterceptors(bean, servletConfig, splitChar);
         setInvoker(bean, servletConfig);
         setExtensions(bean, servletConfig);
@@ -450,6 +449,10 @@ public class CXFNonSpringJaxrsServlet ex
         bean.create();
     }
     
+    protected Class<?> loadApplicationClass(String appClassName) throws ServletException
{
+        return loadClass(appClassName, "Application");
+    }
+    
     protected Class<?> loadClass(String cName) throws ServletException {
         return loadClass(cName, "Resource");
     }



Mime
View raw message