org.jgroups.util
Class AckCollector

java.lang.Object
  extended by org.jgroups.util.AckCollector

public class AckCollector
extends java.lang.Object

Collects acks from a number of nodes, waits for all acks. Can also be time bounded

Author:
Bela Ban

Field Summary
protected  Promise<java.lang.Boolean> all_acks_received
           
protected  int expected_acks
           
protected  java.util.List<Address> missing_acks
          List of members from whom we haven't received an ACK yet
protected  java.util.List<Address> suspected_mbrs
           
 
Constructor Summary
AckCollector()
           
AckCollector(Address... members)
           
AckCollector(java.util.Collection<Address> members)
           
 
Method Summary
 void ack(Address member)
           
protected  void addAll(Address... members)
           
protected  void addAll(java.util.Collection<Address> members)
           
 void destroy()
           
 int expectedAcks()
           
 java.lang.String printMissing()
           
 java.lang.String printSuspected()
           
 void reset(java.util.Collection<Address> members)
           
 boolean retainAll(java.util.Collection<Address> members)
           
 int size()
           
 void suspect(Address member)
           
 java.lang.String toString()
           
 boolean waitForAllAcks()
           
 boolean waitForAllAcks(long timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

missing_acks

protected final java.util.List<Address> missing_acks
List of members from whom we haven't received an ACK yet


all_acks_received

protected final Promise<java.lang.Boolean> all_acks_received

suspected_mbrs

protected final java.util.List<Address> suspected_mbrs

expected_acks

protected int expected_acks
Constructor Detail

AckCollector

public AckCollector()

AckCollector

public AckCollector(java.util.Collection<Address> members)

AckCollector

public AckCollector(Address... members)
Method Detail

reset

public void reset(java.util.Collection<Address> members)

destroy

public void destroy()

size

public int size()

expectedAcks

public int expectedAcks()

ack

public void ack(Address member)

suspect

public void suspect(Address member)

retainAll

public boolean retainAll(java.util.Collection<Address> members)

waitForAllAcks

public boolean waitForAllAcks()

waitForAllAcks

public boolean waitForAllAcks(long timeout)
                       throws TimeoutException
Throws:
TimeoutException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

printMissing

public java.lang.String printMissing()

printSuspected

public java.lang.String printSuspected()

addAll

protected void addAll(Address... members)

addAll

protected void addAll(java.util.Collection<Address> members)


Copyright © 1998-2012 Bela Ban / Red Hat. All Rights Reserved.