cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1433590 - /cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
Date Tue, 15 Jan 2013 19:20:48 GMT
Author: dkulp
Date: Tue Jan 15 19:20:47 2013
New Revision: 1433590

URL: http://svn.apache.org/viewvc?rev=1433590&view=rev
Log:
Make sure each registered service gets it own destination registry

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=1433590&r1=1433589&r2=1433590&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
Tue Jan 15 19:20:47 2013
@@ -23,9 +23,14 @@ 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;
 import org.apache.cxf.dosgi.dsw.util.OsgiUtils;
+import org.apache.cxf.transport.http.DestinationRegistry;
+import org.apache.cxf.transport.http.DestinationRegistryImpl;
 import org.apache.cxf.transport.servlet.CXFNonSpringServlet;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Filter;
@@ -70,7 +75,14 @@ public class HttpServiceManager {
     
     public Bus registerServletAndGetBus(String contextRoot, BundleContext callingContext,
             ServiceReference sref) {
-        CXFNonSpringServlet cxf = new CXFNonSpringServlet();
+        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);
+            }
+        };
         try {
             HttpService httpService = getHttpService();
             httpService.registerServlet(contextRoot, cxf, new Hashtable<String, String>(),




Mime
View raw message