org.apache.shindig.common.cache
Class LruCacheProvider
java.lang.Object
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.
|
Method Summary |
|
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 |
LruCacheProvider
@Inject
public LruCacheProvider(com.google.inject.Injector injector,
int defaultCapacity)
LruCacheProvider
public LruCacheProvider(int capacity)
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 cacheV - 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.