Author: fhanik
Date: Tue May 23 05:32:10 2006
New Revision: 408881

URL: http://svn.apache.org/viewvc?rev=408881&view=rev
Log:
Far from over

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

Modified: 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/NonBlockingCoordinator.java
URL: 
http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/NonBlockingCoordinator.java?rev=408881&r1=408880&r2=408881&view=diff
==============================================================================
--- 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/NonBlockingCoordinator.java
 (original)
+++ 
tomcat/container/tc5.5.x/modules/groupcom/src/share/org/apache/catalina/tribes/group/interceptors/NonBlockingCoordinator.java
 Tue May 23 05:32:10 2006
@@ -79,7 +79,9 @@
  * To synchronize the rest we simply perform the following check at A when A 
receives X:<br>
  * Original X{A-ldr, A-src, mbrs-A,B,C,D} == Arrived X{A-ldr, A-src, 
mbrs-A,B,C,D,E}<br>
  * Since the condition is false, A, will resend the token, and A sends 
X{A-ldr, A-src, mbrs-A,B,C,D,E} to B
- * When A receives X again, the token is complete.
+ * When A receives X again, the token is complete. <br>
+ * Optionally, A can send a message X{A-ldr, A-src, mbrs-A,B,C,D,E confirmed} 
to A,B,C,D,E who then
+ * install and accept the view.
  * </p>
  * <p>
  * Lets assume that C1 arrives, C1 has lower priority than C, but higher 
priority than D.<br>
@@ -188,7 +190,7 @@
                 suggestedview.addMember((MemberImpl)local);
                 Arrays.fill(suggestedview,mbrs);
                 suggestedviewId = new UniqueId(UUIDGenerator.randomUUID(true));
-                CoordinationMessage msg = new 
CoordinationMessage(local,local,suggestedview.getMembers(),suggestedviewId);
+                CoordinationMessage msg = new 
CoordinationMessage(local,local,suggestedview.getMembers(),suggestedviewId,COORD_REQUEST);
                 for (int i=0; i<mbrs.length; i++ ) {
                     try {
                         sendMessage(msg,mbrs[i]);
@@ -370,6 +372,7 @@
         protected MemberImpl source;
         protected MemberImpl[] view;
         protected UniqueId id;
+        protected byte[] type;
         
         public CoordinationMessage(XByteBuffer buf) {
             this.buf = buf;
@@ -378,12 +381,14 @@
         public CoordinationMessage(MemberImpl leader,
                                    MemberImpl source, 
                                    MemberImpl[] view,
-                                   UniqueId id) {
+                                   UniqueId id,
+                                   byte[] type) {
             this.buf = new XByteBuffer(4096,false);
             this.leader = leader;
             this.source = source;
             this.view = view;
             this.id = id;
+            this.type = type;
             this.write();
         }
         
@@ -412,6 +417,11 @@
             return view;
         }
         
+        public byte[] getType() {
+            if (type == null ) parse();
+            return type;
+        }
+        
         public XByteBuffer getBuffer() {
             return this.buf;
         }
@@ -448,6 +458,10 @@
             //id
             this.id = new UniqueId(buf.getBytesDirect(),offset,16);
             offset += 16;
+            type = new byte[16];
+            System.arraycopy(buf.getBytesDirect(), offset, type, 0, 
type.length);
+            offset += 16;
+            
         }
         
         public void write() {
@@ -473,6 +487,7 @@
             }
             //id
             buf.append(id.getBytes(),0,id.getBytes().length);
+            buf.append(type,0,type.length);
         }
         
         



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to