public abstract class AbstractCacheProvider extends Object implements ICacheProvider
Constructor and Description |
---|
AbstractCacheProvider() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
ICache |
createCache(String name,
ICacheEventListener listener)
创建缓存对象,若已存在则直接返回
|
ICache |
getCache(String name)
获取缓存对象,若不存在则创建
|
ICache |
getCache(String name,
boolean create)
获取缓存对象,若不存在则根据create参数决定是否创建缓存对象或返回null
|
ICache |
getCache(String name,
boolean create,
ICacheEventListener listener)
获取缓存对象,若不存在则根据create参数决定是否创建缓存对象或返回null
|
protected ICacheManager |
getCacheManager() |
ICaches |
getOwner()
获取所属缓存管理器
|
void |
initialize(ICaches owner)
初始化
|
boolean |
isInitialized()
是否已初始化
|
protected abstract ICache |
onCreateCache(String cacheName,
ICacheEventListener listener)
创建缓存对象,若已存在则直接返回
|
protected void |
onDestroy()
销毁
|
protected void |
onInitialize()
初始化
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName
protected ICacheManager getCacheManager()
public void initialize(ICaches owner) throws Exception
IInitialization
initialize
in interface IInitialization<ICaches>
owner
- 指定所属容器参数对象Exception
- 初始过程中产生的任何异常public boolean isInitialized()
IInitialization
isInitialized
in interface IInitialization<ICaches>
public void close() throws Exception
close
in interface AutoCloseable
Exception
public ICaches getOwner()
ICacheProvider
getOwner
in interface ICacheProvider
public ICache createCache(String name, ICacheEventListener listener)
ICacheProvider
createCache
in interface ICacheProvider
name
- 缓存名称listener
- 缓存元素过期监听器接口实现protected abstract ICache onCreateCache(String cacheName, ICacheEventListener listener)
cacheName
- 缓存名称listener
- 缓存元素过期监听器接口实现public ICache getCache(String name)
ICacheProvider
getCache
in interface ICacheProvider
name
- 缓存名称public ICache getCache(String name, boolean create)
ICacheProvider
getCache
in interface ICacheProvider
name
- 缓存名称create
- 是否创建缓存对象public ICache getCache(String name, boolean create, ICacheEventListener listener)
ICacheProvider
getCache
in interface ICacheProvider
name
- 缓存名称create
- 是否创建缓存对象listener
- 缓存元素过期监听器接口实现Copyright © 2022. All rights reserved.