Class AbstractPoller
- java.lang.Object
-
- org.apache.sling.testing.clients.util.poller.AbstractPoller
-
- All Implemented Interfaces:
Poller
- Direct Known Subclasses:
PathPoller
@Deprecated public abstract class AbstractPoller extends java.lang.Object implements Poller
Deprecated.usePollinginstead.- See Also:
for a better way to implement polling
-
-
Constructor Summary
Constructors Constructor 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 thePoller.call()andPoller.condition()methods
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleancallAndWait()Deprecated.Calls thePoller.call()once and then callsPoller.condition()until it returns true The method waits AbstractPoller#waitInterval milliseconds between calls toPoller.condition()A maximum of AbstractPoller#waitCount intervals are checkedbooleancallUntilCondition()Deprecated.Calls the @see: Poller#call() and then callsPoller.condition()until it returns true The Poller#call() method is called in each wait interval, before the Poller#condition().
-
-
-
Constructor Detail
-
AbstractPoller
public 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 thePoller.call()andPoller.condition()methods- Parameters:
waitInterval- Number of milliseconds to wait between pollswaitCount- Number of wait intervals
-
-
Method Detail
-
callAndWait
public boolean callAndWait() throws java.lang.InterruptedExceptionDeprecated.Calls thePoller.call()once and then callsPoller.condition()until it returns true The method waits AbstractPoller#waitInterval milliseconds between calls toPoller.condition()A maximum of AbstractPoller#waitCount intervals are checked- Specified by:
callAndWaitin interfacePoller- Returns:
- true if the condition is met after waiting a maximum of AbstractPoller#waitCount intervals, false otherwise
- Throws:
java.lang.InterruptedException- to mark this operation as "waiting"
-
callUntilCondition
public boolean callUntilCondition() throws java.lang.InterruptedExceptionDeprecated.Calls the @see: Poller#call() and then callsPoller.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 toPoller.condition()A maximum of AbstractPoller#waitCount intervals are checked- Specified by:
callUntilConditionin interfacePoller- Returns:
- true if the condition is met after waiting a maximum of AbstractPoller#waitCount intervals, false otherwise
- Throws:
java.lang.InterruptedException- to mark this operation as "waiting"
-
-