HI Mark,

your are right! But then we can use:

CatalinaCluster cluster = getCluster() ;
if(cluster != null) {
        Valve[] valves = cluster.getValves();
..

and also we can optimized the "for"-statement to
                        for(Valve valve: valves) {
                                if(valve instanceof ReplicationValve) {
                                        replicationValve = 
(ReplicationValve)valve ;
                                        break;
                                }
                        }

And I think the replicationValve must be declared as volatile.

Peter

Am 26.04.2010 um 12:43 schrieb Mark Thomas:

On 26/04/2010 10:28, Peter Roßbach wrote:
Hi Mark,

bad fix! The method getValves() only exists at CatalinaCluster!

getCluster() returns an object of type CatalinaCluster. The check wasn't doing anything apart from wasting CPU cycles.

Mark


peter

Am 23.04.2010 um 17:09 schrieb ma...@apache.org:

Modified:
tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/ha/session/DeltaManager.java?rev=937325&r1=937324&r2=937325&view=diff

= = = = = = = = = = ====================================================================

--- tomcat/trunk/java/org/apache/catalina/ha/session/ DeltaManager.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/ha/session/ DeltaManager.java
Fri Apr 23 15:09:58 2010
@@ -882,7 +882,7 @@ public class DeltaManager extends Cluste
if(replicationValve == null) {
if(container instanceof StandardContext &&
((StandardContext)container).getCrossContext()) {
Cluster cluster = getCluster() ;
- if(cluster != null && cluster instanceof CatalinaCluster) {
+ if(cluster != null) {
Valve[] valves = ((CatalinaCluster)cluster).getValves();
if(valves != null && valves.length > 0) {
for(int i=0; replicationValve == null && i < valves.length ; i++ ){






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




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

Reply via email to