Modifier and Type | Class and Description |
---|---|
static interface |
AsyncWaiter.ConditionListener
Condition listener.
|
Modifier and Type | Method and Description |
---|---|
static Cancelable |
wait(Condition condition,
AsyncWaiter.ConditionListener conditionListener,
int retries,
javax.measure.Measurable<javax.measure.quantity.Duration> period,
ThreadExecutor threadExecutor)
Asynchronously waits for the condition to become
true . |
static Cancelable |
wait(Condition condition,
AsyncWaiter.ConditionListener conditionListener,
javax.measure.Measurable<javax.measure.quantity.Duration> period,
ThreadExecutor threadExecutor)
Asynchronously waits for the condition to become
true . |
public static Cancelable wait(Condition condition, AsyncWaiter.ConditionListener conditionListener, int retries, javax.measure.Measurable<javax.measure.quantity.Duration> period, ThreadExecutor threadExecutor) throws NullPointerException, IllegalArgumentException
true
. This
method does not block.condition
- condition to evaluateconditionListener
- listener to notify when the condition is met
or missed if no more evaluations will be performed because the
maximum number of retries is reachedretries
- maximum number of retriesperiod
- duration of one cycle in a repeating event; condition
evaluation periodthreadExecutor
- thread executor used to wait asynchronouslyCancelable
used to cancel the processNullPointerException
- if eithercondition
,
conditionListener
, delay
or
threadExecutor
is null
IllegalArgumentException
- if retries
is less or equals
to zeropublic static Cancelable wait(Condition condition, AsyncWaiter.ConditionListener conditionListener, javax.measure.Measurable<javax.measure.quantity.Duration> period, ThreadExecutor threadExecutor) throws NullPointerException
true
. This
method does not block.condition
- condition to evaluateconditionListener
- listener to notify when the condition is metperiod
- duration of one cycle in a repeating event; condition
evaluation periodthreadExecutor
- thread executor used to wait asynchronouslyCancelable
used to cancel the processNullPointerException
- if eithercondition
,
conditionListener
, delay
or
threadExecutor
is null
Copyright © 2015. All Rights Reserved.