felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1802050 - in /felix/trunk/osgi-r7/http/base: ./ src/main/java/org/apache/felix/http/base/internal/context/ src/main/java/org/apache/felix/http/base/internal/dispatch/ src/main/java/org/apache/felix/http/base/internal/service/ src/main/java...
Date Sun, 16 Jul 2017 12:23:36 GMT
Author: cziegeler
Date: Sun Jul 16 12:23:36 2017
New Revision: 1802050

URL: http://svn.apache.org/viewvc?rev=1802050&view=rev
Log:
R7: Implement finishSecurity

Modified:
    felix/trunk/osgi-r7/http/base/pom.xml
    felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/context/ExtServletContext.java
    felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/InvocationChain.java
    felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/service/ServletContextImpl.java
    felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java

Modified: felix/trunk/osgi-r7/http/base/pom.xml
URL: http://svn.apache.org/viewvc/felix/trunk/osgi-r7/http/base/pom.xml?rev=1802050&r1=1802049&r2=1802050&view=diff
==============================================================================
--- felix/trunk/osgi-r7/http/base/pom.xml (original)
+++ felix/trunk/osgi-r7/http/base/pom.xml Sun Jul 16 12:23:36 2017
@@ -49,7 +49,7 @@
         <dependency>
             <groupId>org.apache.felix</groupId>
             <artifactId>org.apache.felix.http.api</artifactId>
-            <version>3.0.1-R7-SNAPSHOT</version>
+            <version>3.0.1-SNAPSHOT</version>
             <scope>provided</scope>
         </dependency>
         <dependency>

Modified: felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/context/ExtServletContext.java
URL: http://svn.apache.org/viewvc/felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/context/ExtServletContext.java?rev=1802050&r1=1802049&r2=1802050&view=diff
==============================================================================
--- felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/context/ExtServletContext.java
(original)
+++ felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/context/ExtServletContext.java
Sun Jul 16 12:23:36 2017
@@ -30,6 +30,8 @@ public interface ExtServletContext exten
 {
     boolean handleSecurity(HttpServletRequest req, HttpServletResponse res) throws IOException;
 
+    void finishSecurity(HttpServletRequest req, HttpServletResponse res);
+
     HttpSessionAttributeListener getHttpSessionAttributeListener();
 
     HttpSessionListener getHttpSessionListener();

Modified: felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/InvocationChain.java
URL: http://svn.apache.org/viewvc/felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/InvocationChain.java?rev=1802050&r1=1802049&r2=1802050&view=diff
==============================================================================
--- felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/InvocationChain.java
(original)
+++ felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/dispatch/InvocationChain.java
Sun Jul 16 12:23:36 2017
@@ -48,6 +48,7 @@ public class InvocationChain implements
     @Override
     public final void doFilter(@Nonnull final ServletRequest req, @Nonnull final  ServletResponse
res) throws IOException, ServletException
     {
+        boolean callFinish = false;
         if ( this.index == -1 )
         {
             final HttpServletRequest hReq = (HttpServletRequest) req;
@@ -66,17 +67,33 @@ public class InvocationChain implements
                 // we're done
                 return;
             }
+            else
+            {
+                callFinish = true;
+            }
         }
         this.index++;
 
-        if (this.index < this.filterHandlers.length)
+        try
         {
-            this.filterHandlers[this.index].handle(req, res, this);
+            if (this.index < this.filterHandlers.length)
+            {
+                this.filterHandlers[this.index].handle(req, res, this);
+            }
+            else
+            {
+                // Last entry in the chain...
+                this.servletHandler.handle(req, res);
+            }
         }
-        else
-        {
-            // Last entry in the chain...
-            this.servletHandler.handle(req, res);
+        finally {
+            if ( callFinish )
+            {
+                final HttpServletRequest hReq = (HttpServletRequest) req;
+                final HttpServletResponse hRes = (HttpServletResponse) res;
+
+                servletHandler.getContext().finishSecurity(hReq, hRes);
+            }
         }
     }
 }

Modified: felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/service/ServletContextImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/service/ServletContextImpl.java?rev=1802050&r1=1802049&r2=1802050&view=diff
==============================================================================
--- felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/service/ServletContextImpl.java
(original)
+++ felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/service/ServletContextImpl.java
Sun Jul 16 12:23:36 2017
@@ -406,6 +406,11 @@ public class ServletContextImpl implemen
     }
 
     @Override
+    public void finishSecurity(HttpServletRequest req, HttpServletResponse res) {
+        // nothing to do
+    }
+
+    @Override
     public void log(Exception cause, String message)
     {
         SystemLogger.error(message, cause);

Modified: felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java?rev=1802050&r1=1802049&r2=1802050&view=diff
==============================================================================
--- felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java
(original)
+++ felix/trunk/osgi-r7/http/base/src/main/java/org/apache/felix/http/base/internal/whiteboard/PerBundleServletContextImpl.java
Sun Jul 16 12:23:36 2017
@@ -82,6 +82,12 @@ public class PerBundleServletContextImpl
     }
 
     @Override
+    public void finishSecurity(HttpServletRequest req, HttpServletResponse res)
+    {
+        this.contextHelper.finishSecurity(req, res);
+    }
+
+    @Override
     public HttpSessionListener getHttpSessionListener()
     {
         return this.eventListenerRegistry;



Mime
View raw message