org.apache.shindig.common.cache.ehcache
Class EhCacheCacheProvider

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

public class EhCacheCacheProvider
extends Object
implements CacheProvider

Cache interface based on ehcache

See Also:
http://www.ehcache.org

Constructor Summary
EhCacheCacheProvider(String configPath, boolean jmxEnabled, boolean withCacheStats)
           
 
Method Summary
 void create(boolean jmxEnabled, boolean withCacheStats)
           
<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
protected  net.sf.ehcache.config.Configuration getConfiguration(String configPath)
          Read the cache configuration from the specified resource.
 void shutdown()
          perform a shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EhCacheCacheProvider

@Inject
public EhCacheCacheProvider(String configPath,
                                   boolean jmxEnabled,
                                   boolean withCacheStats)
                     throws IOException
Throws:
IOException
Method Detail

getConfiguration

protected net.sf.ehcache.config.Configuration getConfiguration(String configPath)
                                                        throws IOException
Read the cache configuration from the specified resource. This function is intended to be overrideable to allow for programmatic cache configuration.

Parameters:
configPath -
Returns:
Configuration
Throws:
IOException

create

public void create(boolean jmxEnabled,
                   boolean withCacheStats)

shutdown

public void shutdown()
perform a shutdown


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.