Author: markt
Date: Fri Nov 27 18:41:21 2009
New Revision: 884947

URL: http://svn.apache.org/viewvc?rev=884947&view=rev
Log:
Port r795052 from modules/ha to modules/cluster

Modified:
    tomcat/tc5.5.x/trunk/STATUS.txt
    
tomcat/tc5.5.x/trunk/container/modules/cluster/src/share/org/apache/catalina/cluster/session/JvmRouteBinderValve.java
    
tomcat/tc5.5.x/trunk/container/modules/cluster/src/share/org/apache/catalina/cluster/session/LocalStrings.properties

Modified: tomcat/tc5.5.x/trunk/STATUS.txt
URL: 
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/STATUS.txt?rev=884947&r1=884946&r2=884947&view=diff
==============================================================================
--- tomcat/tc5.5.x/trunk/STATUS.txt (original)
+++ tomcat/tc5.5.x/trunk/STATUS.txt Fri Nov 27 18:41:21 2009
@@ -84,15 +84,6 @@
   +1: markt
   -1:
 
-* Port r795052 from modules/ha to modules/cluster
-  Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=40551
-  Enable the JvmRouteBinderValve to work with PersistentManagers as well as 
clusters
-  Patch by Chris Chandler
-  http://svn.apache.org/viewvc?rev=795052&view=rev
-  This has already been applied to OACC: 
http://svn.apache.org/viewvc?rev=812446&view=rev
-  +1: rjung, markt, mturk
-  -1:
-
 * Spurious startup errors in the cluster
   Although the secondary node is able to retrieve all sessions,
   the main thread doesn't see the changed stateTransfered flag,

Modified: 
tomcat/tc5.5.x/trunk/container/modules/cluster/src/share/org/apache/catalina/cluster/session/JvmRouteBinderValve.java
URL: 
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/container/modules/cluster/src/share/org/apache/catalina/cluster/session/JvmRouteBinderValve.java?rev=884947&r1=884946&r2=884947&view=diff
==============================================================================
--- 
tomcat/tc5.5.x/trunk/container/modules/cluster/src/share/org/apache/catalina/cluster/session/JvmRouteBinderValve.java
 (original)
+++ 
tomcat/tc5.5.x/trunk/container/modules/cluster/src/share/org/apache/catalina/cluster/session/JvmRouteBinderValve.java
 Fri Nov 27 18:41:21 2009
@@ -39,6 +39,7 @@
 import org.apache.catalina.connector.Request;
 import org.apache.catalina.connector.Response;
 import org.apache.catalina.session.ManagerBase;
+import org.apache.catalina.session.PersistentManager;
 import org.apache.catalina.util.LifecycleSupport;
 import org.apache.catalina.util.StringManager;
 import org.apache.catalina.valves.ValveBase;
@@ -208,14 +209,19 @@
             ServletException {
 
          if (getEnabled() 
-             && getCluster() != null
              && request.getContext() != null
              && request.getContext().getDistributable() ) {
              // valve cluster can access manager - other cluster handle 
turnover 
              // at host level - hopefully!
              Manager manager = request.getContext().getManager();
-             if (manager != null && manager instanceof ClusterManager
-                     && 
getCluster().getManager(((ClusterManager)manager).getName()) != null)
+             
+             if (manager != null && (
+                     (manager instanceof ClusterManager
+                       && getCluster() != null
+                       && 
getCluster().getManager(((ClusterManager)manager).getName()) != null)
+                     ||
+                     (manager instanceof PersistentManager)))
+             
                  handlePossibleTurnover(request, response);
         }
         // Pass this request on to the next valve in our pipeline
@@ -376,9 +382,13 @@
         if (catalinaSession instanceof DeltaSession)
             ((DeltaSession) catalinaSession).resetDeltaRequest();
         changeRequestSessionID(request, response, sessionId, newSessionID);
-        // now sending the change to all other clusternode!
-        ClusterManager manager = (ClusterManager)catalinaSession.getManager();
-        sendSessionIDClusterBackup(manager,request,sessionId, newSessionID);
+
+        if (getCluster() != null) {
+            // now sending the change to all other clusternode!
+            ClusterManager manager = 
(ClusterManager)catalinaSession.getManager();
+            sendSessionIDClusterBackup(manager,request,sessionId, 
newSessionID);
+        }
+
         lifecycle.fireLifecycleEvent("After session migration", 
catalinaSession);
         if (log.isDebugEnabled()) {
             log.debug(sm.getString("jvmRoute.changeSession", sessionId,
@@ -548,13 +558,12 @@
                 }
             }
         }
-        if (cluster == null) {
-            throw new RuntimeException("No clustering support at container "
-                    + container.getName());
-        }
         
-        if (log.isInfoEnabled())
+        if (log.isInfoEnabled()) {
             log.info(sm.getString("jvmRoute.valve.started"));
+            if (cluster == null)
+                log.info(sm.getString("jvmRoute.noCluster"));
+        }
 
     }
 

Modified: 
tomcat/tc5.5.x/trunk/container/modules/cluster/src/share/org/apache/catalina/cluster/session/LocalStrings.properties
URL: 
http://svn.apache.org/viewvc/tomcat/tc5.5.x/trunk/container/modules/cluster/src/share/org/apache/catalina/cluster/session/LocalStrings.properties?rev=884947&r1=884946&r2=884947&view=diff
==============================================================================
--- 
tomcat/tc5.5.x/trunk/container/modules/cluster/src/share/org/apache/catalina/cluster/session/LocalStrings.properties
 (original)
+++ 
tomcat/tc5.5.x/trunk/container/modules/cluster/src/share/org/apache/catalina/cluster/session/LocalStrings.properties
 Fri Nov 27 18:41:21 2009
@@ -79,6 +79,7 @@
 jvmRoute.lostSession=Lost Session [{0}] at path [{1}]
 jvmRoute.missingJvmRouteAttribute=No engine jvmRoute attribute configured!
 jvmRoute.newSessionCookie=Setting cookie with session id [{0}] name: [{1}] 
path: [{2}] secure: [{3}]
+jvmRoute.noCluster=The JvmRouterBinderValve is configured, but clustering is 
not being used. Fail over will still work, providing a PersistentManager is 
used.
 jvmRoute.notFoundManager=Not found Cluster DeltaManager {0} at {1}
 jvmRoute.receiveMessage.sessionIDChanged=Cluster 
JvmRouteSessionIDBinderListener received orginal session ID [{0}] set to new id 
[{1}] for context path [{2}]
 jvmRoute.run.already=jvmRoute SessionID receiver run already



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to