com.impetus.kundera.cache.ehcache
Class EhCacheProvider

java.lang.Object
  extended by com.impetus.kundera.cache.ehcache.EhCacheProvider
All Implemented Interfaces:
CacheProvider

public class EhCacheProvider
extends Object
implements CacheProvider

Cache provider implementation using Ehcache.

Author:
animesh.kumar

Field Summary
private  javax.persistence.Cache cache
          The cache.
private  boolean initializing
          The initializing.
private  List<net.sf.ehcache.event.CacheEventListener> listeners
          The listeners.
private static org.slf4j.Logger log
          The Constant log.
private  net.sf.ehcache.CacheManager manager
          The manager.
private static String NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME
          The Constant NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME.
 
Constructor Summary
EhCacheProvider()
           
 
Method Summary
 void addDefaultListener(net.sf.ehcache.event.CacheEventListener cacheEventListener)
          Adds the default listener.
 void clearAll()
          Clear all.
 javax.persistence.Cache createCache(String name)
           
 javax.persistence.Cache getCache(String cacheName)
           
 net.sf.ehcache.CacheManager getCacheManager()
          Gets the cache manager.
 void init(Map<?,?> properties)
           
 void init(String cacheResourceName)
           
private  URL loadResource(String configurationResourceName)
          Load resource.
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.slf4j.Logger log
The Constant log.


manager

private net.sf.ehcache.CacheManager manager
The manager.


cache

private javax.persistence.Cache cache
The cache.


NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME

private static final String NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME
The Constant NET_SF_EHCACHE_CONFIGURATION_RESOURCE_NAME.

See Also:
Constant Field Values

initializing

private boolean initializing
The initializing.


listeners

private List<net.sf.ehcache.event.CacheEventListener> listeners
The listeners.

Constructor Detail

EhCacheProvider

public EhCacheProvider()
Method Detail

init

public void init(String cacheResourceName)
Specified by:
init in interface CacheProvider

init

public void init(Map<?,?> properties)
Specified by:
init in interface CacheProvider

loadResource

private URL loadResource(String configurationResourceName)
Load resource.

Parameters:
configurationResourceName - the configuration resource name
Returns:
the uRL

createCache

public javax.persistence.Cache createCache(String name)
Specified by:
createCache in interface CacheProvider

getCache

public javax.persistence.Cache getCache(String cacheName)
                                 throws CacheException
Specified by:
getCache in interface CacheProvider
Throws:
CacheException

shutdown

public void shutdown()
Specified by:
shutdown in interface CacheProvider

clearAll

public void clearAll()
Clear all.


getCacheManager

public net.sf.ehcache.CacheManager getCacheManager()
Gets the cache manager.

Returns:
the cache manager

addDefaultListener

public void addDefaultListener(net.sf.ehcache.event.CacheEventListener cacheEventListener)
Adds the default listener.

Parameters:
cacheEventListener - the cache event listener


Copyright © 2014. All Rights Reserved.