Follow up on pero's review comments.
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 28 Apr 2010 23:07:43 +0000 (23:07 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 28 Apr 2010 23:07:43 +0000 (23:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@939130 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/ha/session/DeltaManager.java

index c440fd2..d88ebd0 100644 (file)
@@ -94,7 +94,7 @@ public class DeltaManager extends ClusterManagerBase{
     /**
      * cached replication valve cluster container!
      */
-    private ReplicationValve replicationValve = null ;
+    private volatile ReplicationValve replicationValve = null ;
     
     /**
      * The maximum number of active Sessions allowed, or -1 for no limit.
@@ -882,9 +882,9 @@ public class DeltaManager extends ClusterManagerBase{
     protected void registerSessionAtReplicationValve(DeltaSession session) {
         if(replicationValve == null) {
             if(container instanceof StandardContext && ((StandardContext)container).getCrossContext()) {
-                Cluster cluster = getCluster() ;
+                CatalinaCluster cluster = getCluster() ;
                 if(cluster != null) {
-                    Valve[] valves = ((CatalinaCluster)cluster).getValves();
+                    Valve[] valves = cluster.getValves();
                     if(valves != null && valves.length > 0) {
                         for(int i=0; replicationValve == null && i < valves.length ; i++ ){
                             if(valves[i] instanceof ReplicationValve) replicationValve = (ReplicationValve)valves[i] ;