tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r408816 - /tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java
Date Tue, 23 May 2006 02:01:45 GMT
Author: fhanik
Date: Mon May 22 19:01:44 2006
New Revision: 408816

URL: http://svn.apache.org/viewvc?rev=408816&view=rev
Log:
Added some notes about possible optimizations

Modified:
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java?rev=408816&r1=408815&r2=408816&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/TwoPhaseCommitInterceptor.java
Mon May 22 19:01:44 2006
@@ -51,7 +51,10 @@
 
     public void sendMessage(Member[] destination, ChannelMessage msg, InterceptorPayload
payload) throws
         ChannelException {
-        if (okToProcess(msg.getOptions())) {
+        //todo, optimize, if destination.length==1, then we can do
+        //msg.setOptions(msg.getOptions() & (~getOptionFlag())
+        //and just send one message
+        if (okToProcess(msg.getOptions()) ) {
             super.sendMessage(destination, msg, null);
             ChannelMessage confirmation = null;
             if ( deepclone ) confirmation = (ChannelMessage)msg.deepclone();
@@ -63,6 +66,10 @@
             confirmation.getMessage().append(END_DATA,0,END_DATA.length);
             super.sendMessage(destination,confirmation,payload);
         } else {
+            //turn off two phase commit
+            //this wont work if the interceptor has 0 as a flag
+            //since there is no flag to turn off
+            //msg.setOptions(msg.getOptions() & (~getOptionFlag()));
             super.sendMessage(destination, msg, payload);
         }
     }



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


Mime
View raw message