public class EhCacheProvider extends Object implements CacheProvider
Modifier and Type | Field and Description |
---|---|
static String |
KEY_EHCACHE_CONFIG_XML |
static String |
KEY_EHCACHE_NAME |
Constructor and Description |
---|
EhCacheProvider() |
Modifier and Type | Method and Description |
---|---|
EhCache |
buildCache(String regionName,
CacheExpiredListener listener)
Builds a Cache.
|
EhCache |
buildCache(String region,
long timeToLiveInSeconds,
CacheExpiredListener listener)
Configure the cache with timeToLiveInMills
|
int |
level()
缓存的层级
|
String |
name()
缓存的标识名称
|
Collection<CacheChannel.Region> |
regions()
Return all channels defined in first level cache
|
void |
removeCache(String region)
Remove a cache region
|
void |
start(Properties props)
init ehcache config
|
void |
stop()
Callback to perform any necessary cleanup of the underlying cache implementation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isLevel
public static final String KEY_EHCACHE_NAME
public static final String KEY_EHCACHE_CONFIG_XML
public String name()
CacheProvider
name
in interface CacheProvider
public int level()
CacheProvider
level
in interface CacheProvider
public Collection<CacheChannel.Region> regions()
CacheProvider
regions
in interface CacheProvider
public EhCache buildCache(String regionName, CacheExpiredListener listener)
buildCache
in interface CacheProvider
regionName
- the regionName of the cache. Must match a cache configured in ehcache.xmllistener
- cache listenerpublic EhCache buildCache(String region, long timeToLiveInSeconds, CacheExpiredListener listener)
CacheProvider
buildCache
in interface CacheProvider
region
- cache region nametimeToLiveInSeconds
- time to live in secondlistener
- listener for expired elementspublic void removeCache(String region)
CacheProvider
removeCache
in interface CacheProvider
region
- cache region namepublic void start(Properties props)
start
in interface CacheProvider
props
- current configuration settings.public void stop()
stop
in interface CacheProvider
Copyright © 2018. All rights reserved.