org.apache.shindig.common.cache
Class LruCacheProvider

java.lang.Object
  extended by org.apache.shindig.common.cache.LruCacheProvider
All Implemented Interfaces:
CacheProvider

public class LruCacheProvider
extends Object
implements CacheProvider

A cache provider that always produces LRU caches. LRU cache sizes can be configured by specifying property names in the form shindig.cache.lru..capacity=foo The default value is expected under shindig.cache.lru.default.capacity An in memory LRU cache only scales so far. For a production-worthy cache, use EhCacheCacheProvider.


Constructor Summary
LruCacheProvider(com.google.inject.Injector injector, int defaultCapacity)
           
LruCacheProvider(int capacity)
           
 
Method Summary
<K,V> Cache<K,V>
createCache(String name)
          Create a named single instance cache in this cache manager, if the cache already exists, return it if the name is null, a new anonymous cache is created
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LruCacheProvider

@Inject
public LruCacheProvider(com.google.inject.Injector injector,
                               int defaultCapacity)

LruCacheProvider

public LruCacheProvider(int capacity)
Method Detail

createCache

public <K,V> Cache<K,V> createCache(String name)
Description copied from interface: CacheProvider
Create a named single instance cache in this cache manager, if the cache already exists, return it if the name is null, a new anonymous cache is created

Specified by:
createCache in interface CacheProvider
Type Parameters:
K - The Key type for the cache
V - The pay-load type
Parameters:
name - The non-null name of the cache.
Returns:
A Cache configured to the required specification.


Copyright © 2007-2012. All Rights Reserved.