tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Roßbach ...@objektpark.de>
Subject Re: svn commit: r937325 - in /tomcat/trunk/java/org/apache: catalina/ha/session/DeltaManager.java el/lang/ExpressionBuilder.java
Date Mon, 26 Apr 2010 11:00:11 GMT
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 markt@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-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>
>


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


Mime
View raw message