cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1080479 - in /cxf/branches/2.3.x-fixes: ./ rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
Date Fri, 11 Mar 2011 07:40:10 GMT
Author: ffang
Date: Fri Mar 11 07:40:10 2011
New Revision: 1080479

URL: http://svn.apache.org/viewvc?rev=1080479&view=rev
Log:
Merged revisions 1080469 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1080469 | ffang | 2011-03-11 15:02:58 +0800 (δΊ”, 11  3 2011) | 1 line
  
  [CXF-3369]set SecurityHandler which wrap JettyHttpHandler to the ContextHandler
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java?rev=1080479&r1=1080478&r2=1080479&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
Fri Mar 11 07:40:10 2011
@@ -297,6 +297,7 @@ public class JettyHTTPServerEngine
      * @param handler notified on incoming HTTP requests
      */
     public synchronized void addServant(URL url, JettyHTTPHandler handler) {
+        SecurityHandler securityHandler = null;
         if (server == null) {
             DefaultHandler defaultHandler = null;
             // create a new jetty server instance if there is no server there           

@@ -351,7 +352,6 @@ public class JettyHTTPServerEngine
              * one to start, or it is now one containing only the single handler
              * that was there to begin with.
              */
-
             if (handlers != null && handlers.size() > 0) {
                 for (Handler h : handlers) {
                     // Filtering out the jetty default handler 
@@ -366,8 +366,10 @@ public class JettyHTTPServerEngine
                             //set JettyHTTPHandler as inner handler if 
                             //inner handler is null
                             ((SecurityHandler)h).setHandler(handler);
-                        } 
-                        handlerCollection.addHandler(h);
+                            securityHandler = (SecurityHandler)h;
+                        } else {
+                            handlerCollection.addHandler(h);
+                        }
                     }
                 }
             }
@@ -415,11 +417,21 @@ public class JettyHTTPServerEngine
                 sessionManager.setIdManager(idManager);
             }
             SessionHandler sessionHandler = new SessionHandler(sessionManager);
-            sessionHandler.setHandler(handler);
+            if (securityHandler != null) {
+                //use the securityHander which already wrap the jetty http handler
+                sessionHandler.setHandler(securityHandler);
+            } else {
+                sessionHandler.setHandler(handler);
+            }
             context.setHandler(sessionHandler);
         } else {
             // otherwise, just the one.
-            context.setHandler(handler);
+            if (securityHandler != null) {
+                //use the securityHander which already wrap the jetty http handler
+                context.setHandler(securityHandler);
+            } else {
+                context.setHandler(handler);
+            }
         }
         contexts.addHandler(context);
         



Mime
View raw message