axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From az...@apache.org
Subject svn commit: r594882 - in /webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering: context/DefaultContextManager.java tribes/AckManager.java tribes/ChannelSender.java
Date Wed, 14 Nov 2007 13:51:43 GMT
Author: azeez
Date: Wed Nov 14 05:51:37 2007
New Revision: 594882

URL: http://svn.apache.org/viewvc?rev=594882&view=rev
Log:
Do not wait for ACKs or try to resend the message if this message contains non-serializable
parts


Modified:
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManager.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManager.java?rev=594882&r1=594881&r2=594882&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManager.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/context/DefaultContextManager.java
Wed Nov 14 05:51:37 2007
@@ -52,7 +52,7 @@
 
     public DefaultContextManager() {
     }
-    
+
     public String updateContext(AbstractContext context) throws ClusteringFault {
         ContextClusteringCommand cmd =
                 ContextClusteringCommandFactory.getUpdateCommand(context,
@@ -161,15 +161,21 @@
                             configContext.setNonReplicableProperty(ClusteringConstants.TIME_TO_SEND,
                                                                    new Long(tts));
                         } catch (ClusteringFault clusteringFault) {
+                            AckManager.removeMessage(cmd.getUniqueId());
                             throw new RuntimeException(clusteringFault);
                         }
                     }
                 };
                 processorThread.start();
             } else {
-                long tts = sender.sendToGroup(cmd);
-                configContext.setNonReplicableProperty(ClusteringConstants.TIME_TO_SEND,
-                                                       new Long(tts));
+                try {
+                    long tts = sender.sendToGroup(cmd);
+                    configContext.setNonReplicableProperty(ClusteringConstants.TIME_TO_SEND,
+                                                           new Long(tts));
+                } catch (ClusteringFault clusteringFault) {
+                    AckManager.removeMessage(cmd.getUniqueId());
+                    throw clusteringFault;
+                }
             }
         }
     }

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java?rev=594882&r1=594881&r2=594882&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/AckManager.java
Wed Nov 14 05:51:37 2007
@@ -51,11 +51,18 @@
         }
     }
 
+    public static void removeMessage(String messageUniqueId){
+        messageAckTable.remove(messageUniqueId);
+    }
+
     public static boolean isMessageAcknowledged(String messageUniqueId,
                                                 ChannelSender sender) throws ClusteringFault
{
 
         boolean isAcknowledged = false;
         MessageACK ack = (MessageACK) messageAckTable.get(messageUniqueId);
+        if(ack == null){  // If the message is not found, treat it as ACKed
+            return true;
+        }
 
         // Check that all members in the memberList are same as the total member list,
         // which will indicate that all members have ACKed the message

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java?rev=594882&r1=594881&r2=594882&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java
Wed Nov 14 05:51:37 2007
@@ -28,9 +28,10 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import java.io.ObjectOutputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
+import java.io.NotSerializableException;
+import java.io.ObjectOutputStream;
 
 public class ChannelSender implements MessageSender {
 
@@ -54,10 +55,15 @@
                     timeToSend = System.currentTimeMillis() - start;
                     log.debug("Sent " + msg + " to group");
                     break;
+                } catch (NotSerializableException e) {
+                    String message = "Could not send command message " + msg +
+                                     " to group since it is not serializable.";
+                    log.error(message, e);
+                    throw new ClusteringFault(message, e);
                 } catch (Exception e) {
                     String message = "Error sending command message : " + msg +
                                      ". Reason " + e.getMessage();
-                    log.warn(message);
+                    log.warn(message, e);
                 }
             } else {
                 break;
@@ -98,10 +104,15 @@
                 timeToSend = System.currentTimeMillis() - start;
                 log.debug("Sent " + cmd + " to " + TribesUtil.getHost(member));
             }
+        } catch (NotSerializableException e) {
+            String message = "Could not send command message to " + TribesUtil.getHost(member)
 +
+                             " since it is not serializable.";
+            log.error(message, e);
+            throw new ClusteringFault(message, e);
         } catch (Exception e) {
             String message = "Could not send message to " + TribesUtil.getHost(member) +
                              ". Reason " + e.getMessage();
-            log.warn(message);
+            log.warn(message, e);
         }
         return timeToSend;
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message