public class SpringRedisProvider extends Object implements CacheProvider
Modifier and Type | Field and Description |
---|---|
protected ConcurrentHashMap<String,Cache> |
caches |
Constructor and Description |
---|
SpringRedisProvider() |
Modifier and Type | Method and Description |
---|---|
Cache |
buildCache(String region,
CacheExpiredListener listener)
Configure the cache
|
Cache |
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 |
start(Properties props)
Callback to perform any necessary initialization of the underlying cache implementation
during SessionFactory construction.
|
void |
stop()
Callback to perform any necessary cleanup of the underlying cache implementation
during SessionFactory.close().
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isLevel, removeCache
protected ConcurrentHashMap<String,Cache> caches
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 Cache buildCache(String region, CacheExpiredListener listener)
CacheProvider
buildCache
in interface CacheProvider
region
- the name of the cache regionlistener
- listener for expired elementspublic Cache 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 start(Properties props)
CacheProvider
start
in interface CacheProvider
props
- current configuration settings.public void stop()
CacheProvider
stop
in interface CacheProvider
Copyright © 2018. All rights reserved.