Package org.jgroups.util
Class ResponseCollectorTask<T>
- java.lang.Object
-
- org.jgroups.util.ResponseCollector<T>
-
- org.jgroups.util.ResponseCollectorTask<T>
-
public class ResponseCollectorTask<T> extends ResponseCollector<T>
Task which is seeded with an initial membership. Periodically executes a runnable (which e.g. sends a message) and stops when responses from all members have been received, or the task is stopped.- Since:
- 4.0.5
- Author:
- Bela Ban
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.function.Consumer<ResponseCollectorTask<T>>
finalizer_task
protected java.util.function.Consumer<ResponseCollectorTask<T>>
periodic_task
protected java.util.concurrent.Future<?>
runner
protected java.lang.Runnable
stub
-
Constructor Summary
Constructors Constructor Description ResponseCollectorTask()
ResponseCollectorTask(java.util.Collection<Address> members)
ResponseCollectorTask(Address... members)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
add(Address member, T data)
boolean
isDone()
boolean
retainAll(java.util.List<Address> members)
ResponseCollectorTask<T>
setFinalizerTask(java.util.function.Consumer<ResponseCollectorTask<T>> r)
ResponseCollectorTask<T>
setPeriodicTask(java.util.function.Consumer<ResponseCollectorTask<T>> pt)
ResponseCollectorTask<T>
start(TimeScheduler timer, long initial_delay, long interval)
ResponseCollectorTask<T>
stop()
-
Methods inherited from class org.jgroups.util.ResponseCollector
getMissing, getResults, getValidResults, hasAllResponses, numberOfValidResponses, remove, remove, reset, reset, reset, size, suspect, toString, waitForAllResponses
-
-
-
-
Field Detail
-
periodic_task
protected java.util.function.Consumer<ResponseCollectorTask<T>> periodic_task
-
finalizer_task
protected java.util.function.Consumer<ResponseCollectorTask<T>> finalizer_task
-
runner
protected java.util.concurrent.Future<?> runner
-
stub
protected final java.lang.Runnable stub
-
-
Method Detail
-
setPeriodicTask
public ResponseCollectorTask<T> setPeriodicTask(java.util.function.Consumer<ResponseCollectorTask<T>> pt)
-
setFinalizerTask
public ResponseCollectorTask<T> setFinalizerTask(java.util.function.Consumer<ResponseCollectorTask<T>> r)
-
isDone
public boolean isDone()
-
start
public ResponseCollectorTask<T> start(TimeScheduler timer, long initial_delay, long interval)
-
stop
public ResponseCollectorTask<T> stop()
-
add
public boolean add(Address member, T data)
- Overrides:
add
in classResponseCollector<T>
-
retainAll
public boolean retainAll(java.util.List<Address> members)
- Overrides:
retainAll
in classResponseCollector<T>
-
-