axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From az...@apache.org
Subject svn commit: r659949 - /webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java
Date Sun, 25 May 2008 09:56:55 GMT
Author: azeez
Date: Sun May 25 02:56:54 2008
New Revision: 659949

URL: http://svn.apache.org/viewvc?rev=659949&view=rev
Log:
Optimizing the number of messages sent when a member joins


Modified:
    webservices/axis2/trunk/java/modules/clustering/src/org/apache/axis2/clustering/tribes/TribesClusterManager.java

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=659949&r1=659948&r2=659949&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
Sun May 25 02:56:54 2008
@@ -185,32 +185,22 @@
                                                        Channel.SEND_OPTIONS_ASYNCHRONOUS,
                                                        10000);
                 for (Response response : responses) {
-                    Member source = response.getSource();
                     MemberListCommand command = (MemberListCommand) response.getMessage();
                     command.setMembershipManager(membershipManager);
                     command.setStaticMembershipInterceptor(staticMembershipInterceptor);
                     command.execute(configurationContext);
+                }
 
-                    log.info("Sending MEMBER_JOINED to group...");
-                    MemberJoinedCommand memberJoinedCommand = new MemberJoinedCommand();
-                    memberJoinedCommand.setMember(membershipManager.getLocalMember());
-                    try {
-                        Member[] currentMembers = membershipManager.getMembers();
-                        Member[] sendTo = new Member[currentMembers.length - 1];
-                        int j = 0;
-                        for (Member currentMember : currentMembers) {
-                            if (!currentMember.equals(source)) {  // Don't send back to the
sender
-                                sendTo[j] = currentMember;
-                                j++;
-                            }
-                        }
-                        rpcChannel.send(sendTo, memberJoinedCommand, RpcChannel.ALL_REPLY,
-                                        Channel.SEND_OPTIONS_ASYNCHRONOUS, 10000);
-                    } catch (ChannelException e) {
-                        String msg = "Could not send MEMBER_JOINED message to group";
-                        log.error(msg, e);
-                        throw new ClusteringFault(msg, e);
-                    }
+                log.info("Sending MEMBER_JOINED to group...");
+                MemberJoinedCommand memberJoinedCommand = new MemberJoinedCommand();
+                memberJoinedCommand.setMember(membershipManager.getLocalMember());
+                try {
+                    rpcChannel.send(membershipManager.getMembers(), memberJoinedCommand,
+                                    RpcChannel.ALL_REPLY, Channel.SEND_OPTIONS_ASYNCHRONOUS,
10000);
+                } catch (ChannelException e) {
+                    String msg = "Could not send MEMBER_JOINED message to group";
+                    log.error(msg, e);
+                    throw new ClusteringFault(msg, e);
                 }
             } catch (ChannelException e) {
                 String msg = "Could not JOIN group";



Mime
View raw message