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 (cherry picked from commit e18a3b9097491c10be4db3943c09de0f2a286ac9)
Date Thu, 14 Aug 2014 08:27:42 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 2afb9d3ca -> f8f5bc310


[CXF-5946]ensure unregister cxf http transport Servlet OSGi service before we re-register
it
(cherry picked from commit e18a3b9097491c10be4db3943c09de0f2a286ac9)


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

Branch: refs/heads/master
Commit: f8f5bc310acd1565d904e0c3c12eaeb4d7e63add
Parents: 2afb9d3
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:27:27 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/f8f5bc31/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