tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r1068996 - /tomcat/trunk/java/org/apache/catalina/tribes/group/RpcChannel.java
Date Wed, 09 Feb 2011 17:47:14 GMT
Author: fhanik
Date: Wed Feb  9 17:47:13 2011
New Revision: 1068996

URL: http://svn.apache.org/viewvc?rev=1068996&view=rev
Log:
remove loop that should not be used at all.

Modified:
    tomcat/trunk/java/org/apache/catalina/tribes/group/RpcChannel.java

Modified: tomcat/trunk/java/org/apache/catalina/tribes/group/RpcChannel.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/group/RpcChannel.java?rev=1068996&r1=1068995&r2=1068996&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/tribes/group/RpcChannel.java (original)
+++ tomcat/trunk/java/org/apache/catalina/tribes/group/RpcChannel.java Wed Feb  9 17:47:13
2011
@@ -132,44 +132,42 @@ public class RpcChannel implements Chann
             final ExtendedRpcCallback excallback = (callback instanceof ExtendedRpcCallback)?((ExtendedRpcCallback)callback)
: null;
             boolean asyncReply = ((replyMessageOptions & Channel.SEND_OPTIONS_ASYNCHRONOUS)
== Channel.SEND_OPTIONS_ASYNCHRONOUS);
             Serializable reply = callback.replyRequest(rmsg.message,sender);
-            while (!finished) {
-                ErrorHandler handler = null;
-                final Serializable request = msg;
-                final Serializable response = reply;
-                final Member fsender = sender;
-                if (excallback!=null && asyncReply) {
-                    handler = new ErrorHandler() {
-                        @Override
-                        public void handleError(ChannelException x, UniqueId id) {
-                            excallback.replyFailed(request, response, fsender, x);
-                        }
-                        @Override
-                        public void handleCompletion(UniqueId id) {
-                            excallback.replySucceeded(request, response, fsender);
-                        }
-                    };
-                }
-                rmsg.reply = true;
-                rmsg.message = reply;
-                try {
-                    if (handler!=null) {
-                        channel.send(new Member[] {sender}, rmsg,replyMessageOptions &
~Channel.SEND_OPTIONS_SYNCHRONIZED_ACK, handler);
-                    } else {
-                        channel.send(new Member[] {sender}, rmsg,replyMessageOptions &
~Channel.SEND_OPTIONS_SYNCHRONIZED_ACK);
+            ErrorHandler handler = null;
+            final Serializable request = msg;
+            final Serializable response = reply;
+            final Member fsender = sender;
+            if (excallback!=null && asyncReply) {
+                handler = new ErrorHandler() {
+                    @Override
+                    public void handleError(ChannelException x, UniqueId id) {
+                        excallback.replyFailed(request, response, fsender, x);
                     }
-                    finished = true;
-                }catch ( Exception x )  {
-                    if (excallback != null && !asyncReply) {
-                        finished = !excallback.replyFailed(rmsg.message, reply, sender, x);
-                    } else {
-                        finished = true;
-                        log.error("Unable to send back reply in RpcChannel.",x);
+                    @Override
+                    public void handleCompletion(UniqueId id) {
+                        excallback.replySucceeded(request, response, fsender);
                     }
+                };
+            }
+            rmsg.reply = true;
+            rmsg.message = reply;
+            try {
+                if (handler!=null) {
+                    channel.send(new Member[] {sender}, rmsg,replyMessageOptions & ~Channel.SEND_OPTIONS_SYNCHRONIZED_ACK,
handler);
+                } else {
+                    channel.send(new Member[] {sender}, rmsg,replyMessageOptions & ~Channel.SEND_OPTIONS_SYNCHRONIZED_ACK);
                 }
-                if (finished && excallback != null && !asyncReply) {
-                    excallback.replySucceeded(rmsg.message, reply, sender);
+                finished = true;
+            }catch ( Exception x )  {
+                if (excallback != null && !asyncReply) {
+                    finished = !excallback.replyFailed(rmsg.message, reply, sender, x);
+                } else {
+                    finished = true;
+                    log.error("Unable to send back reply in RpcChannel.",x);
                 }
             }
+            if (finished && excallback != null && !asyncReply) {
+                excallback.replySucceeded(rmsg.message, reply, sender);
+            }
         }//end if
     }
     



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


Mime
View raw message