类 CaffeineProvider
java.lang.Object
net.oschina.j2cache.caffeine.CaffeineProvider
- 所有已实现的接口:
CacheProvider
Caffeine cache provider
- 作者:
- Winter Lau(javayou@gmail.com)
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明buildCache(String region, long timeToLiveInSeconds, CacheExpiredListener listener) Configure the cache with timeToLiveInMillsbuildCache(String region, CacheExpiredListener listener) Configure the cacheintlevel()缓存的层级name()缓存的标识名称regions()Return all channels defined in first level cachevoidremoveCache(String region) Remove a cache regionvoidstart(Properties props) 配置示例voidstop()Callback to perform any necessary cleanup of the underlying cache implementation during SessionFactory.close().从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 net.oschina.j2cache.CacheProvider
isLevel
-
构造器详细资料
-
CaffeineProvider
public CaffeineProvider()
-
-
方法详细资料
-
name
从接口复制的说明:CacheProvider缓存的标识名称- 指定者:
name在接口中CacheProvider- 返回:
- return cache provider name
-
level
public int level()从接口复制的说明:CacheProvider缓存的层级- 指定者:
level在接口中CacheProvider- 返回:
- current provider level
-
regions
从接口复制的说明:CacheProviderReturn all channels defined in first level cache- 指定者:
regions在接口中CacheProvider- 返回:
- all regions name
-
buildCache
从接口复制的说明:CacheProviderConfigure the cache- 指定者:
buildCache在接口中CacheProvider- 参数:
region- the name of the cache regionlistener- listener for expired elements- 返回:
- return cache instance
-
buildCache
从接口复制的说明:CacheProviderConfigure the cache with timeToLiveInMills- 指定者:
buildCache在接口中CacheProvider- 参数:
region- cache region nametimeToLiveInSeconds- time to live in secondlistener- listener for expired elements- 返回:
- return cache instance
-
removeCache
从接口复制的说明:CacheProviderRemove a cache region- 指定者:
removeCache在接口中CacheProvider- 参数:
region- cache region name
-
start
配置示例
- caffeine.region.default = 10000,1h
- caffeine.region.Users = 10000,1h
- caffeine.region.Blogs = 80000,30m
- 指定者:
start在接口中CacheProvider- 参数:
props- current configuration settings.
-
stop
public void stop()从接口复制的说明:CacheProviderCallback to perform any necessary cleanup of the underlying cache implementation during SessionFactory.close().- 指定者:
stop在接口中CacheProvider
-