cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: Better fix to the demo compilation issue
Date Wed, 08 Oct 2014 09:14:50 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 9110a9f93 -> 74b552206


Better fix to the demo compilation issue


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/74b55220
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/74b55220
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/74b55220

Branch: refs/heads/master
Commit: 74b552206ef02af502a0470964887a2421b7fd12
Parents: 9110a9f
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Wed Oct 8 10:14:29 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Wed Oct 8 10:14:29 2014 +0100

----------------------------------------------------------------------
 .../src/main/java/minimalosgi/SampleServlet.java       |  5 ++---
 .../cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java    | 13 +++++++++++--
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/74b55220/distribution/src/main/release/samples/jax_rs/minimal_osgi/src/main/java/minimalosgi/SampleServlet.java
----------------------------------------------------------------------
diff --git a/distribution/src/main/release/samples/jax_rs/minimal_osgi/src/main/java/minimalosgi/SampleServlet.java
b/distribution/src/main/release/samples/jax_rs/minimal_osgi/src/main/java/minimalosgi/SampleServlet.java
index 1d8b946..a75274c 100644
--- a/distribution/src/main/release/samples/jax_rs/minimal_osgi/src/main/java/minimalosgi/SampleServlet.java
+++ b/distribution/src/main/release/samples/jax_rs/minimal_osgi/src/main/java/minimalosgi/SampleServlet.java
@@ -23,16 +23,15 @@ import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
 import javax.ws.rs.core.Application;
 import org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet;
-import org.apache.cxf.jaxrs.model.ApplicationInfo;
 
 public class SampleServlet extends CXFNonSpringJaxrsServlet {
 
     private static final long serialVersionUID = -1531317723099896635L;
 
     @Override
-    protected ApplicationInfo createApplicationInstance(String appClassName, ServletConfig
servletConfig) 
+    protected Application createApplicationInstance(String appClassName, ServletConfig servletConfig)

         throws ServletException {
-        return new ApplicationInfo(new SampleApplication(), super.getBus());
+        return new SampleApplication();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/cxf/blob/74b55220/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
index 71fd949..9ac7616 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/servlet/CXFNonSpringJaxrsServlet.java
@@ -450,7 +450,7 @@ public class CXFNonSpringJaxrsServlet extends CXFNonSpringServlet {
         }
         
         for (String cName : classNames) {
-            ApplicationInfo providerApp = createApplicationInstance(cName, servletConfig);
+            ApplicationInfo providerApp = createApplicationInfo(cName, servletConfig);
             
             JAXRSServerFactoryBean bean = ResourceUtils.createApplication(providerApp.getProvider(),

                                                 ignoreApplicationPath,
@@ -467,8 +467,17 @@ public class CXFNonSpringJaxrsServlet extends CXFNonSpringServlet {
         }
     }
     
-    protected ApplicationInfo createApplicationInstance(String appClassName, ServletConfig
servletConfig) 
+    protected Application createApplicationInstance(String appClassName, ServletConfig servletConfig)
         throws ServletException {
+        return null;
+    }
+    protected ApplicationInfo createApplicationInfo(String appClassName, ServletConfig servletConfig)

+        throws ServletException {
+        
+        Application customApp = createApplicationInstance(appClassName, servletConfig);
+        if (customApp != null) {
+            return new ApplicationInfo(customApp, getBus());
+        }
         Map<String, List<String>> props = new HashMap<String, List<String>>();
         appClassName = getClassNameAndProperties(appClassName, props);
         Class<?> appClass = loadApplicationClass(appClassName);


Mime
View raw message