axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From az...@apache.org
Subject svn commit: r610685 - in /webservices/axis2/trunk/java/modules: clustering/src/org/apache/axis2/clustering/tribes/ clustering/test/org/apache/axis2/clustering/ kernel/conf/ kernel/src/org/apache/axis2/clustering/context/
Date Thu, 10 Jan 2008 05:55:54 GMT
Author: azeez
Date: Wed Jan  9 21:55:53 2008
New Revision: 610685

URL: http://svn.apache.org/viewvc?rev=610685&view=rev
Log:
Added maxRetries setting


Modified:
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelListener.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelSender.java
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java
    webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/ClusterManagerTestCase.java
    webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextManager.java

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelListener.java?rev=610685&r1=610684&r2=610685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelListener.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/ChannelListener.java
Wed Jan  9 21:55:53 2008
@@ -99,10 +99,21 @@
         this.configurationContext = configurationContext;
     }
 
+    /**
+     * Invoked by the channel to determine if the listener will process this message or not.
+     * @param msg Serializable
+     * @param sender Member
+     * @return boolean
+     */
     public boolean accept(Serializable msg, Member sender) {
         return true;
     }
 
+    /**
+     * Receive a message from the channel
+     * @param msg Serializable
+     * @param sender - the source of the message
+     */
     public void messageReceived(Serializable msg, Member sender) {
         try {
             AxisConfiguration configuration = configurationContext.getAxisConfiguration();

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=610685&r1=610684&r2=610685&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 Jan  9 21:55:53 2008
@@ -61,16 +61,14 @@
                 log.error(message, e);
                 throw new ClusteringFault(message, e);
             } catch (ChannelException e) {
-                ChannelException.FaultyMember[] faultyMembers = e.getFaultyMembers();
-                for (int i = 0; i < faultyMembers.length; i++) {
-                    ChannelException.FaultyMember faultyMember = faultyMembers[i];
-                    Member member = faultyMember.getMember();
-                    log.error("Member " + TribesUtil.getHost(member) + " is faulty. Cause
" +
-                              faultyMember.getCause(), faultyMember.getCause());
-                    if (!(e.getCause() instanceof java.net.ConnectException)) { // If it
is not a connection exception, we try to resend the message
-                        sendToMember(msg, member);
-                    }
-                }
+                log.error("Could not send message to some members", e);
+//                ChannelException.FaultyMember[] faultyMembers = e.getFaultyMembers();
+//                for (int i = 0; i < faultyMembers.length; i++) {
+//                    ChannelException.FaultyMember faultyMember = faultyMembers[i];
+//                    Member member = faultyMember.getMember();
+//                    log.error("Member " + TribesUtil.getHost(member) + " is faulty. Cause
" +
+//                              faultyMember.getCause(), faultyMember.getCause());
+//                }
             } catch (Exception e) {
                 String message = "Error sending command message : " + msg +
                                  ". Reason " + e.getMessage();
@@ -118,12 +116,13 @@
             log.error(message, e);
             throw new ClusteringFault(message, e);
         } catch (ChannelException e) {
-            ChannelException.FaultyMember[] faultyMembers = e.getFaultyMembers();
-            log.error("Member " + TribesUtil.getHost(member) + " is faulty. Cause " +
-                      faultyMembers[0].getCause(), faultyMembers[0].getCause());
-            if (!(e.getCause() instanceof java.net.ConnectException)) { // If it is not a
connection exception, we try to resend the message
-                sendToMember(cmd, member);
-            }
+            log.error("Could not send message to " + TribesUtil.getHost(member));
+//            ChannelException.FaultyMember[] faultyMembers = e.getFaultyMembers();
+//            log.error("Member " + TribesUtil.getHost(member) + " is faulty. Cause " +
+//                      faultyMembers[0].getCause(), faultyMembers[0].getCause());
+//            if (!(e.getCause() instanceof java.net.ConnectException)) { // If it is not
a connection exception, we try to resend the message
+//                sendToMember(cmd, member);
+//            }
         } catch (Exception e) {
             String message = "Could not send message to " + TribesUtil.getHost(member) +
                              ". Reason " + e.getMessage();

Modified: webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java?rev=610685&r1=610684&r2=610685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java
Wed Jan  9 21:55:53 2008
@@ -47,7 +47,9 @@
 import org.apache.catalina.tribes.group.GroupChannel;
 import org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor;
 import org.apache.catalina.tribes.group.interceptors.TcpFailureDetector;
+import org.apache.catalina.tribes.group.interceptors.OrderInterceptor;
 import org.apache.catalina.tribes.transport.ReceiverBase;
+import org.apache.catalina.tribes.transport.ReplicationTransmitter;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -133,7 +135,14 @@
         controlCmdProcessor.setChannelSender(channelSender);
         channel = new GroupChannel();
 
-
+        // Set the maximum number of retries, if message sending to a particular node fails
+        Parameter maxRetriesParam = getParameter("maxRetries");
+        int maxRetries = 10;
+        if (maxRetriesParam != null) {
+            maxRetries = Integer.parseInt((String) maxRetriesParam.getValue());
+        }
+        ((ReplicationTransmitter) channel.getChannelSender()).
+                getTransport().setMaxRetryAttempts(maxRetries);
 
         // Set the IP address that will be advertised by this node
         String localIP = System.getProperty(ClusteringConstants.LOCAL_IP_ADDRESS);
@@ -175,6 +184,9 @@
        mcastProps.setProperty("mcastFrequency", "500");
        mcastProps.setProperty("tcpListenPort", "4000");
        mcastProps.setProperty("tcpListenHost", "127.0.0.1");*/
+
+//        OrderInterceptor orderInterceptor = new OrderInterceptor();
+        
 
         TcpFailureDetector tcpFailureDetector = new TcpFailureDetector();
         tcpFailureDetector.setPrevious(dfi);

Modified: webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/ClusterManagerTestCase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/ClusterManagerTestCase.java?rev=610685&r1=610684&r2=610685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/ClusterManagerTestCase.java
(original)
+++ webservices/axis2/trunk/java/modules/clustering/test/org/apache/axis2/clustering/ClusterManagerTestCase.java
Wed Jan  9 21:55:53 2008
@@ -95,10 +95,10 @@
         System.setProperty(ClusteringConstants.LOCAL_IP_ADDRESS, HttpUtils.getIpAddress());
         try {
             clusterManager1.init();
-            System.out.println("############ ClusterManager-1 successfully initialized");
+            System.out.println("ClusterManager-1 successfully initialized");
             System.out.println("*** PLEASE IGNORE THE java.net.ConnectException STACKTRACES.
THIS IS EXPECTED ***");
             clusterManager2.init();
-            System.out.println("############ ClusterManager-2 successfully initialized");
+            System.out.println("ClusterManager-2 successfully initialized");
         } catch (ClusteringFault e) {
             String message =
                     "Could not initialize ClusterManagers. Please check the network connection";

Modified: webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml?rev=610685&r1=610684&r2=610685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/kernel/conf/axis2.xml Wed Jan  9 21:55:53 2008
@@ -351,6 +351,7 @@
         <parameter name="param1">value1</parameter>
         <parameter name="domain">apache.axis2.domain</parameter>
         <parameter name="synchronizeAll">true</parameter>
+        <parameter name="maxRetries">10</parameter>
     	<configurationManager class="org.apache.axis2.cluster.configuration.TribesConfigurationManager">
     	    <listener class="org.apache.axis2.cluster.configuration.DefaultConfigurationManagerListener"/>
     	</configurationManager>

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextManager.java?rev=610685&r1=610684&r2=610685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextManager.java
(original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/clustering/context/ContextManager.java
Wed Jan  9 21:55:53 2008
@@ -63,7 +63,7 @@
     String updateContexts(AbstractContext[] contexts) throws ClusteringFault;
 
     /**
-     * This method is called when a new {@link AbstractContext} is removed from the system
+     * This method is called when {@link AbstractContext} is removed from the system
      *
      * @param context The AbstractContext to be removed
      * @return The UUID of the message that was sent to the group communications framework



---------------------------------------------------------------------
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