K
- the base key type for all cache loaders created by this decoratorV
- the base value type for all cache loaders created by this decorator@Beta public class RetryingCacheLoaderDecorator<K,V> extends Object
A decorator of CacheLoader
instances having any combination of the following features:
Usage example:
Modifier and Type | Class and Description |
---|---|
static class |
RetryingCacheLoaderDecorator.BackoffExponentiallyAndRetryOnThrowableCacheLoaderDecorator<K,V> |
static class |
RetryingCacheLoaderDecorator.OnThrowableBuilder<K,V> |
Modifier | Constructor and Description |
---|---|
protected |
RetryingCacheLoaderDecorator() |
Modifier and Type | Method and Description |
---|---|
<K1 extends K,V1 extends V> |
decorate(com.google.common.cache.CacheLoader<K1,V1> loader)
Decorates a cacheloader, or returns the same value, if no retrying features were requested.
|
static RetryingCacheLoaderDecorator<Object,Object> |
newDecorator()
Constructs a new
RetryingCacheLoaderDecorator instance with default settings, and no
retrying any kind. |
RetryingCacheLoaderDecorator.OnThrowableBuilder<K,V> |
on(Class<? extends Throwable> retryableThrowable)
Determines the action to carry out on a particular throwable.
|
protected com.google.common.base.Objects.ToStringHelper |
string()
append any state that should be considered in
toString() here. |
String |
toString()
Returns a string representation for this RetryingCacheLoaderDecorator instance.
|
public static RetryingCacheLoaderDecorator<Object,Object> newDecorator()
RetryingCacheLoaderDecorator
instance with default settings, and no
retrying any kind.public RetryingCacheLoaderDecorator.OnThrowableBuilder<K,V> on(Class<? extends Throwable> retryableThrowable)
public <K1 extends K,V1 extends V> com.google.common.cache.CacheLoader<K1,V1> decorate(com.google.common.cache.CacheLoader<K1,V1> loader)
This method does not alter the state of this RetryingCacheLoaderDecorator
instance, so
it can be invoked again to create multiple independent cache loaders.
loader
- the cache loader used to obtain new valuespublic String toString()
protected com.google.common.base.Objects.ToStringHelper string()
toString()
here.Copyright © 2009-2013 jclouds. All Rights Reserved.