Polling
instead.@Deprecated public abstract class AbstractPoller extends Object implements Poller
for a better way to implement polling
Constructor and Description |
---|
AbstractPoller(long waitInterval,
long waitCount)
Deprecated.
Convenience method to execute a generic call and do polling until a condition is met
The user must implement the
Poller.call() and Poller.condition() methods |
Modifier and Type | Method and Description |
---|---|
boolean |
callAndWait()
Deprecated.
Calls the
Poller.call() once and then calls Poller.condition() until it returns true
The method waits AbstractPoller#waitInterval milliseconds between calls to Poller.condition()
A maximum of AbstractPoller#waitCount intervals are checked |
boolean |
callUntilCondition()
Deprecated.
Calls the @see: Poller#call() and then calls
Poller.condition() until it returns true
The Poller#call() method is called in each wait interval, before the Poller#condition(). |
public AbstractPoller(long waitInterval, long waitCount)
Poller.call()
and Poller.condition()
methodswaitInterval
- Number of milliseconds to wait between pollswaitCount
- Number of wait intervalspublic boolean callAndWait() throws InterruptedException
Poller.call()
once and then calls Poller.condition()
until it returns true
The method waits AbstractPoller#waitInterval milliseconds between calls to Poller.condition()
A maximum of AbstractPoller#waitCount intervals are checkedcallAndWait
in interface Poller
InterruptedException
- to mark this operation as "waiting"public boolean callUntilCondition() throws InterruptedException
Poller.condition()
until it returns true
The Poller#call() method is called in each wait interval, before the Poller#condition().
The method waits AbstractPoller#waitInterval milliseconds between calls to Poller.condition()
A maximum of AbstractPoller#waitCount intervals are checkedcallUntilCondition
in interface Poller
InterruptedException
- to mark this operation as "waiting"Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.