Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50184
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 9 Nov 2010 17:08:25 +0000 (17:08 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 9 Nov 2010 17:08:25 +0000 (17:08 +0000)
Add an option to the RpcChannel to enable the Channel send options to be set for the reply message.
Based on a patch by Ariel.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1033102 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/tribes/group/RpcChannel.java
webapps/docs/changelog.xml

index 37b650a..6fddeb1 100644 (file)
@@ -44,7 +44,8 @@ public class RpcChannel implements ChannelListener{
     private Channel channel;
     private RpcCallback callback;
     private byte[] rpcId;
-    
+    private int replyMessageOptions = 0;
+
     private HashMap<RpcCollectorKey, RpcCollector> responseMap = new HashMap<RpcCollectorKey, RpcCollector>();
 
     /**
@@ -130,7 +131,8 @@ public class RpcChannel implements ChannelListener{
             rmsg.reply = true;
             rmsg.message = reply;
             try {
-                channel.send(new Member[] {sender}, rmsg,0);
+                channel.send(new Member[] {sender}, rmsg,
+                        replyMessageOptions & ~Channel.SEND_OPTIONS_SYNCHRONIZED_ACK);
             }catch ( Exception x )  {
                 log.error("Unable to send back reply in RpcChannel.",x);
             }
@@ -178,7 +180,14 @@ public class RpcChannel implements ChannelListener{
         this.rpcId = rpcId;
     }
 
+    public int getReplyMessageOptions() {
+        return replyMessageOptions;
+    }
 
+    public void setReplyMessageOptions(int replyMessageOptions) {
+        this.replyMessageOptions = replyMessageOptions;
+    }
+        
     /**
      * 
      * Class that holds all response.
index de041b0..68d57b2 100644 (file)
         If maxInactiveInterval is negative, an access message is not sending. 
         (kfujino)
       </fix>
+      <fix>
+        <bug>50184</bug>: Add an option to the RpcChannel to enable the Channel
+        send options to be set for the reply message. Based on a patch by Ariel.
+        (markt))
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Web applications">