tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fha...@apache.org
Subject svn commit: r399350 - in /tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes: group/interceptors/TcpFailureDetector.java membership/Membership.java
Date Wed, 03 May 2006 16:54:19 GMT
Author: fhanik
Date: Wed May  3 09:54:15 2006
New Revision: 399350

URL: http://svn.apache.org/viewcvs?rev=399350&view=rev
Log:
fixed some small code issues

Modified:
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
    tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/membership/Membership.java

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java?rev=399350&r1=399349&r2=399350&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/TcpFailureDetector.java
Wed May  3 09:54:15 2006
@@ -189,6 +189,7 @@
                 data.setTimestamp(System.currentTimeMillis());
                 int options = getOptionFlag() | Channel.SEND_OPTIONS_BYTE_MESSAGE;
                 if ( performReadTest ) options = (options | Channel.SEND_OPTIONS_USE_ACK);
+                else options = (options & (~Channel.SEND_OPTIONS_USE_ACK));
                 data.setOptions(options);
                 byte[] message = XByteBuffer.createDataPackage(data);
                 socket.getOutputStream().write(message);

Modified: tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/membership/Membership.java
URL: http://svn.apache.org/viewcvs/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/membership/Membership.java?rev=399350&r1=399349&r2=399350&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/membership/Membership.java
(original)
+++ tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/membership/Membership.java
Wed May  3 09:54:15 2006
@@ -92,9 +92,7 @@
         //return true if the membership has changed
         MbrEntry entry = (MbrEntry)map.get(member);
         if ( entry == null ) {
-            entry = new MbrEntry(member);
-            map.put(member,entry);
-            addMember(member);
+            entry = addMember(member);
             result = true;
        } else {
             //update the member alive time
@@ -113,15 +111,16 @@
      * Add a member to this component and sort array with memberComparator
      * @param member The member to add
      */
-    public void addMember(MemberImpl member) {
+    public synchronized MbrEntry addMember(MemberImpl member) {
       synchronized (members) {
-          MemberImpl results[] =
-            new MemberImpl[members.length + 1];
-          for (int i = 0; i < members.length; i++)
-              results[i] = members[i];
+          MbrEntry entry = new MbrEntry(member);
+          map.put(member,entry);
+          MemberImpl results[] = new MemberImpl[members.length + 1];
+          for (int i = 0; i < members.length; i++) results[i] = members[i];
           results[members.length] = member;
           members = results;
           Arrays.sort(members, memberComparator);
+          return entry;
       }
     }
     



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


Mime
View raw message