incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fmesc...@apache.org
Subject svn commit: r896372 - in /sling/trunk/bundles/engine: pom.xml src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java
Date Wed, 06 Jan 2010 10:36:38 GMT
Author: fmeschbe
Date: Wed Jan  6 10:36:36 2010
New Revision: 896372

URL: http://svn.apache.org/viewvc?rev=896372&view=rev
Log:
SLING-1270 temporarily add code to log out the request session, to be removed when proper
ServletRequestListener support can be assumed.

Modified:
    sling/trunk/bundles/engine/pom.xml
    sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java

Modified: sling/trunk/bundles/engine/pom.xml
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/engine/pom.xml?rev=896372&r1=896371&r2=896372&view=diff
==============================================================================
--- sling/trunk/bundles/engine/pom.xml (original)
+++ sling/trunk/bundles/engine/pom.xml Wed Jan  6 10:36:36 2010
@@ -95,6 +95,12 @@
         </plugins>
     </reporting>
     <dependencies>
+        <!-- Temporary dependency for SLING-1270-->
+        <dependency>
+            <groupId>javax.jcr</groupId>
+            <artifactId>jcr</artifactId>
+        </dependency>
+        <!-- END Temporary dependency for SLING-1270-->
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.api</artifactId>

Modified: sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java?rev=896372&r1=896371&r2=896372&view=diff
==============================================================================
--- sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java
(original)
+++ sling/trunk/bundles/engine/src/main/java/org/apache/sling/engine/impl/SlingMainServlet.java
Wed Jan  6 10:36:36 2010
@@ -32,6 +32,7 @@
 import java.util.List;
 import java.util.Map;
 
+import javax.jcr.Session;
 import javax.servlet.Filter;
 import javax.servlet.FilterChain;
 import javax.servlet.FilterConfig;
@@ -252,6 +253,7 @@
             requestLogger.logRequestEntry(request, response);
         }
 
+        ResourceResolver resolver = null;
         try {
             // check that we have all required services
             String errorMessage = null;
@@ -263,7 +265,7 @@
             }
 
             // get ResourceResolver (set by AuthenticationSupport)
-            final ResourceResolver resolver = (ResourceResolver) servletRequest.getAttribute(AuthenticationSupport.REQUEST_ATTRIBUTE_RESOLVER);
+            resolver = (ResourceResolver) servletRequest.getAttribute(AuthenticationSupport.REQUEST_ATTRIBUTE_RESOLVER);
             if (resolver == null) {
                 errorMessage = "Missing ResourceResolver";
             }
@@ -364,6 +366,20 @@
 
             // dispose any request data
             requestData.dispose();
+
+            // FIXME: This must be removed
+            // SLING-1270 Temporary solution to ensure session is logged out
+            if (resolver != null) {
+                Session session = resolver.adaptTo(Session.class);
+                if (session != null && session.isLive()) {
+                    try {
+                        session.logout();
+                    } catch (Throwable t) {
+                        // ignore
+                    }
+                }
+            }
+            // END SLING-1270 Temporary solution to ensure session is logged out
         }
     }
 



Mime
View raw message