org.jclouds.cache
Class ForwardingCacheLoader<K,V>

java.lang.Object
  extended by com.google.common.cache.CacheLoader<K,V>
      extended by org.jclouds.cache.ForwardingCacheLoader<K,V>
Direct Known Subclasses:
BackoffExponentiallyAndRetryOnThrowableCacheLoader, ForwardingCacheLoader.SimpleForwardingCacheLoader

@Beta
public abstract class ForwardingCacheLoader<K,V>
extends com.google.common.cache.CacheLoader<K,V>

A ForwardingCacheLoader.SimpleForwardingCacheLoader which forwards all its method calls to another ForwardingCacheLoader.SimpleForwardingCacheLoader. Subclasses should override one or more methods to modify the behavior of the backing cache as desired per the decorator pattern.

Since:
1.5
Author:
Adrian Cole

Nested Class Summary
static class ForwardingCacheLoader.SimpleForwardingCacheLoader<K,V>
          A simplified version of ForwardingCacheLoader where subclasses can pass in an already constructed CacheLoader as the delegate.
 
Nested classes/interfaces inherited from class com.google.common.cache.CacheLoader
com.google.common.cache.CacheLoader.InvalidCacheLoadException
 
Constructor Summary
protected ForwardingCacheLoader()
          Constructor for use by subclasses.
 
Method Summary
protected abstract  com.google.common.cache.CacheLoader<K,V> delegate()
           
 V load(K key)
           
 Map<K,V> loadAll(Iterable<? extends K> keys)
           
 com.google.common.util.concurrent.ListenableFuture<V> reload(K key, V oldValue)
           
 
Methods inherited from class com.google.common.cache.CacheLoader
from, from
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForwardingCacheLoader

protected ForwardingCacheLoader()
Constructor for use by subclasses.

Method Detail

delegate

protected abstract com.google.common.cache.CacheLoader<K,V> delegate()

load

public V load(K key)
       throws Exception
Specified by:
load in class com.google.common.cache.CacheLoader<K,V>
Throws:
Exception

reload

public com.google.common.util.concurrent.ListenableFuture<V> reload(K key,
                                                                    V oldValue)
                                                             throws Exception
Overrides:
reload in class com.google.common.cache.CacheLoader<K,V>
Throws:
Exception

loadAll

public Map<K,V> loadAll(Iterable<? extends K> keys)
                 throws Exception
Overrides:
loadAll in class com.google.common.cache.CacheLoader<K,V>
Throws:
Exception


Copyright © 2009-2013 jclouds. All Rights Reserved.