cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1433870 - /cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
Date Wed, 16 Jan 2013 09:49:18 GMT
Author: cschneider
Date: Wed Jan 16 09:49:18 2013
New Revision: 1433870

URL: http://svn.apache.org/viewvc?rev=1433870&view=rev
Log:
DOSGI-145 Small refactor to avoid creating a custom CXFServlet

Modified:
    cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java

Modified: cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
URL: http://svn.apache.org/viewvc/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java?rev=1433870&r1=1433869&r2=1433870&view=diff
==============================================================================
--- cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
(original)
+++ cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
Wed Jan 16 09:49:18 2013
@@ -23,8 +23,6 @@ import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Map;
 
-import javax.servlet.ServletConfig;
-
 import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.dosgi.dsw.Constants;
@@ -75,14 +73,10 @@ public class HttpServiceManager {
     
     public Bus registerServletAndGetBus(String contextRoot, BundleContext callingContext,
             ServiceReference sref) {
-        CXFNonSpringServlet cxf = new CXFNonSpringServlet() {
-            private static final long serialVersionUID = 1L;
-            protected void loadBus(ServletConfig sc) {
-                Bus b = BusFactory.newInstance().createBus();
-                b.setExtension(new DestinationRegistryImpl(), DestinationRegistry.class);
-                this.setBus(b);
-            }
-        };
+        Bus bus = BusFactory.newInstance().createBus();
+        bus.setExtension(new DestinationRegistryImpl(), DestinationRegistry.class);
+        CXFNonSpringServlet cxf = new CXFNonSpringServlet();
+        cxf.setBus(bus);
         try {
             HttpService httpService = getHttpService();
             httpService.registerServlet(contextRoot, cxf, new Hashtable<String, String>(),

@@ -93,7 +87,7 @@ public class HttpServiceManager {
         } catch (Exception e) {
             throw new ServiceException("CXF DOSGi: problem registering CXF HTTP Servlet",
e);
         }
-        return cxf.getBus();
+        return bus;
     }
 
     protected HttpService getHttpService() {



Mime
View raw message