org.jclouds.predicates
Class RetryableNumTimesPredicate<T>
java.lang.Object
org.jclouds.predicates.RetryableNumTimesPredicate<T>
- All Implemented Interfaces:
- com.google.common.base.Predicate<T>
public class RetryableNumTimesPredicate<T>
- extends Object
- implements com.google.common.base.Predicate<T>
Retries a condition until it is met or the max number of retries have occurred.
maxAttempts parameter is required.
Initial retry period and retry maxPeriod are optionally configurable,
defaulting to 50ms and 1000ms respectively,
with the retrier increasing the interval by a factor of 1.5 each time within these constraints.
- Author:
- Aled Sage
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.google.common.base.Predicate |
equals |
logger
protected Logger logger
RetryableNumTimesPredicate
public RetryableNumTimesPredicate(com.google.common.base.Predicate<T> predicate,
int maxAttempts,
long period,
long maxPeriod,
TimeUnit unit)
RetryableNumTimesPredicate
public RetryableNumTimesPredicate(com.google.common.base.Predicate<T> predicate,
int maxAttempts,
long period,
TimeUnit unit)
RetryableNumTimesPredicate
public RetryableNumTimesPredicate(com.google.common.base.Predicate<T> predicate,
int maxAttempts)
apply
public boolean apply(T input)
- Specified by:
apply
in interface com.google.common.base.Predicate<T>
nextMaxInterval
protected long nextMaxInterval(long attempt)
Copyright © 2009-2012 jclouds. All Rights Reserved.