geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gdam...@apache.org
Subject svn commit: r694867 - in /geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src: main/java/org/apache/geronimo/tomcat/cluster/ClusteredManager.java test/java/org/apache/geronimo/tomcat/cluster/ClusteredManagerTest.java
Date Sat, 13 Sep 2008 02:10:08 GMT
Author: gdamour
Date: Fri Sep 12 19:10:08 2008
New Revision: 694867

URL: http://svn.apache.org/viewvc?rev=694867&view=rev
Log:
GERONIMO-4299 - Session invalidation problem - WADI Tomcat Clustering

Tomcat session has already been removed from its session manager when it is
invalidated. So when WADI calls back when the session it manages is destroyed,
the wrapping Tomcat session may already be unregistered.

Modified:
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/ClusteredManager.java
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/test/java/org/apache/geronimo/tomcat/cluster/ClusteredManagerTest.java

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/ClusteredManager.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/ClusteredManager.java?rev=694867&r1=694866&r2=694867&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/ClusteredManager.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/main/java/org/apache/geronimo/tomcat/cluster/ClusteredManager.java
Fri Sep 12 19:10:08 2008
@@ -74,6 +74,9 @@
 
         public void notifySessionDestruction(org.apache.geronimo.clustering.Session session)
{
             ClusteredSession clusteredSession = getClusteredSession(session);
+            if (null == clusteredSession) {
+                return;
+            }
             remove(clusteredSession);
         }
         

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/test/java/org/apache/geronimo/tomcat/cluster/ClusteredManagerTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/test/java/org/apache/geronimo/tomcat/cluster/ClusteredManagerTest.java?rev=694867&r1=694866&r2=694867&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/test/java/org/apache/geronimo/tomcat/cluster/ClusteredManagerTest.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6-clustering-wadi/src/test/java/org/apache/geronimo/tomcat/cluster/ClusteredManagerTest.java
Fri Sep 12 19:10:08 2008
@@ -30,6 +30,8 @@
 import org.apache.geronimo.clustering.SessionListener;
 import org.apache.geronimo.clustering.SessionManager;
 
+import com.agical.rmock.core.Action;
+import com.agical.rmock.core.MethodHandle;
 import com.agical.rmock.core.describe.ExpressionDescriber;
 import com.agical.rmock.core.match.operator.AbstractExpression;
 import com.agical.rmock.extension.junit.RMockTestCase;
@@ -138,9 +140,15 @@
         assertFalse(httpSession.isNew());
     }
     
-    public void testInvalidateSessionReleasesUnderlyingSession() throws Exception {
-        org.apache.geronimo.clustering.Session underlyingSession =recordCreateUnderlyingSession();
+    public void testInvalidateSessionReleasesUnderlyingSessionAndRemoveSessionFromManager()
throws Exception {
+        final org.apache.geronimo.clustering.Session underlyingSession =recordCreateUnderlyingSession();
         underlyingSession.release();
+        modify().perform(new Action() {
+            public Object invocation(Object[] arg0, MethodHandle arg1) throws Throwable {
+                sessionListener.notifySessionDestruction(underlyingSession);
+                return null;
+            }
+        });
         
         startVerification();
 
@@ -148,6 +156,8 @@
         Session session = manager.createSession(null);
         HttpSession httpSession = session.getSession();
         httpSession.invalidate();
+        
+        assertNull(manager.findSession(sessionId));
     }
     
     public void testSessionEndAccessTriggersOnEndAccess() throws Exception {



Mime
View raw message