org.jclouds.cache
Class RetryingCacheLoaderDecorator.BackoffExponentiallyAndRetryOnThrowableCacheLoaderDecorator<K,V>

java.lang.Object
  extended by org.jclouds.cache.RetryingCacheLoaderDecorator<K,V>
      extended by org.jclouds.cache.RetryingCacheLoaderDecorator.BackoffExponentiallyAndRetryOnThrowableCacheLoaderDecorator<K,V>
Enclosing class:
RetryingCacheLoaderDecorator<K,V>

public static class RetryingCacheLoaderDecorator.BackoffExponentiallyAndRetryOnThrowableCacheLoaderDecorator<K,V>
extends RetryingCacheLoaderDecorator<K,V>


Nested Class Summary
 
Nested classes/interfaces inherited from class org.jclouds.cache.RetryingCacheLoaderDecorator
RetryingCacheLoaderDecorator.BackoffExponentiallyAndRetryOnThrowableCacheLoaderDecorator<K,V>, RetryingCacheLoaderDecorator.OnThrowableBuilder<K,V>
 
Constructor Summary
protected RetryingCacheLoaderDecorator.BackoffExponentiallyAndRetryOnThrowableCacheLoaderDecorator(Class<? extends Throwable> retryableThrowable)
           
 
Method Summary
<K1 extends K,V1 extends V>
com.google.common.cache.CacheLoader<K1,V1>
decorate(com.google.common.cache.CacheLoader<K1,V1> loader)
          Decorates a cacheloader, or returns the same value, if no retrying features were requested.
 RetryingCacheLoaderDecorator.BackoffExponentiallyAndRetryOnThrowableCacheLoaderDecorator<K,V> maxPeriodMs(long maxPeriodMs)
          The initial period in milliseconds to delay between tries.
 RetryingCacheLoaderDecorator.BackoffExponentiallyAndRetryOnThrowableCacheLoaderDecorator<K,V> maxTries(int maxTries)
          The maximum attempts to try on the given exception type

default: 5

 RetryingCacheLoaderDecorator.BackoffExponentiallyAndRetryOnThrowableCacheLoaderDecorator<K,V> periodMs(long periodMs)
          The initial period in milliseconds to delay between tries.
protected  com.google.common.base.Objects.ToStringHelper string()
          append any state that should be considered in RetryingCacheLoaderDecorator.toString() here.
 
Methods inherited from class org.jclouds.cache.RetryingCacheLoaderDecorator
newDecorator, on, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RetryingCacheLoaderDecorator.BackoffExponentiallyAndRetryOnThrowableCacheLoaderDecorator

protected RetryingCacheLoaderDecorator.BackoffExponentiallyAndRetryOnThrowableCacheLoaderDecorator(Class<? extends Throwable> retryableThrowable)
Method Detail

periodMs

public RetryingCacheLoaderDecorator.BackoffExponentiallyAndRetryOnThrowableCacheLoaderDecorator<K,V> periodMs(long periodMs)
The initial period in milliseconds to delay between tries. with each try this period will increase exponentially.

default: 100


maxPeriodMs

public RetryingCacheLoaderDecorator.BackoffExponentiallyAndRetryOnThrowableCacheLoaderDecorator<K,V> maxPeriodMs(long maxPeriodMs)
The initial period in milliseconds to delay between tries. with each try this period will increase exponentially.

default: 200


maxTries

public RetryingCacheLoaderDecorator.BackoffExponentiallyAndRetryOnThrowableCacheLoaderDecorator<K,V> maxTries(int maxTries)
The maximum attempts to try on the given exception type

default: 5


decorate

public <K1 extends K,V1 extends V> com.google.common.cache.CacheLoader<K1,V1> decorate(com.google.common.cache.CacheLoader<K1,V1> loader)
Description copied from class: RetryingCacheLoaderDecorator
Decorates a cacheloader, or returns the same value, if no retrying features were requested.

This method does not alter the state of this RetryingCacheLoaderDecorator instance, so it can be invoked again to create multiple independent cache loaders.

Overrides:
decorate in class RetryingCacheLoaderDecorator<K,V>
Parameters:
loader - the cache loader used to obtain new values
Returns:
a cache loader having the requested features

string

protected com.google.common.base.Objects.ToStringHelper string()
Description copied from class: RetryingCacheLoaderDecorator
append any state that should be considered in RetryingCacheLoaderDecorator.toString() here.

Overrides:
string in class RetryingCacheLoaderDecorator<K,V>


Copyright © 2009-2013 jclouds. All Rights Reserved.