You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2013/01/15 20:20:48 UTC
svn commit: r1433590 -
/cxf/dosgi/trunk/dsw/cxf-dsw/src/main/java/org/apache/cxf/dosgi/dsw/handlers/HttpServiceManager.java
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>(),