cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject git commit: [CXF-5946]ensure unregister cxf http transport Servlet OSGi service before we re-register it
Date Thu, 14 Aug 2014 08:26:48 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 5ec029fcf -> e18a3b909


[CXF-5946]ensure unregister cxf http transport Servlet OSGi service before we re-register
it


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

Branch: refs/heads/3.0.x-fixes
Commit: e18a3b9097491c10be4db3943c09de0f2a286ac9
Parents: 5ec029f
Author: Freeman Fang <freeman.fang@gmail.com>
Authored: Thu Aug 14 16:26:28 2014 +0800
Committer: Freeman Fang <freeman.fang@gmail.com>
Committed: Thu Aug 14 16:26:28 2014 +0800

----------------------------------------------------------------------
 .../apache/cxf/transport/http/osgi/HTTPTransportActivator.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/e18a3b90/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HTTPTransportActivator.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HTTPTransportActivator.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HTTPTransportActivator.java
index 82087bc..c01afb4 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HTTPTransportActivator.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HTTPTransportActivator.java
@@ -96,6 +96,7 @@ public class HTTPTransportActivator
         private ServiceRegistration reg;
         private BundleContext context;
         private Servlet servlet;
+        private ServiceRegistration serviceRegistration;
         
         public ServletConfigurer(BundleContext context, Servlet servlet) {
             this.servlet = servlet;
@@ -140,7 +141,10 @@ public class HTTPTransportActivator
                        getProp(properties, "org.apache.cxf.servlet.service-list-page-authenticate-realm",
"karaf"));
             sprops.put("use-x-forwarded-headers", 
                        getProp(properties, "org.apache.cxf.servlet.use-x-forwarded-headers",
"false"));
-            context.registerService(Servlet.class.getName(), servlet, sprops);
+            if (serviceRegistration != null) {
+                serviceRegistration.unregister();
+            }
+            serviceRegistration = context.registerService(Servlet.class.getName(), servlet,
sprops);
         }
 
         @SuppressWarnings("rawtypes")


Mime
View raw message