Package org.jgroups.util
Class ResponseCollector<T>
java.lang.Object
org.jgroups.util.ResponseCollector<T>
Similar to AckCollector, but collects responses, not just acks. Null is not a valid key.
- Version:
- $Id: ResponseCollector.java,v 1.1.2.5 2009/04/21 10:09:22 belaban Exp $
- Author:
- Bela Ban
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
void
void
reset()
void
reset
(Collection<Address> members) int
size()
void
toString()
boolean
waitForAllResponses
(long timeout) Waits until all responses have been received, or until a timeout has elapsed.
-
Constructor Details
-
ResponseCollector
- Parameters:
members
- List of members from which we expect responses
-
ResponseCollector
public ResponseCollector()
-
-
Method Details
-
add
-
remove
-
suspect
-
hasAllResponses
public boolean hasAllResponses() -
getResults
-
size
public int size() -
waitForAllResponses
public boolean waitForAllResponses(long timeout) Waits until all responses have been received, or until a timeout has elapsed.- Parameters:
timeout
- Number of milliseconds to wait max. This value needs to be greater than 0, or else it will be adjusted to 2000- Returns:
- boolean True if all responses have been received within timeout ms, else false (e.g. if interrupted)
-
reset
public void reset() -
reset
-
toString
-