public class JDBCDiskCacheFactory extends AbstractAuxiliaryCacheFactory implements IRequireScheduler
Modifier and Type | Field and Description |
---|---|
protected static String |
ATTRIBUTE_PREFIX
.attributes
|
protected static String |
POOL_CONFIGURATION_PREFIX
props prefix
|
protected ScheduledExecutorService |
scheduler
The background scheduler, one for all regions.
|
Constructor and Description |
---|
JDBCDiskCacheFactory() |
Modifier and Type | Method and Description |
---|---|
<K,V> JDBCDiskCache<K,V> |
createCache(AuxiliaryCacheAttributes rawAttr,
ICompositeCacheManager compositeCacheManager,
ICacheEventLogger cacheEventLogger,
IElementSerializer elementSerializer)
This factory method should create an instance of the jdbc cache.
|
protected void |
createShrinkerWhenNeeded(JDBCDiskCacheAttributes cattr,
JDBCDiskCache<?,?> raf)
If UseDiskShrinker is true then we will create a shrinker daemon if necessary.
|
void |
dispose()
Dispose of this factory, clean up shared resources
|
protected DataSourceFactory |
getDataSourceFactory(JDBCDiskCacheAttributes cattr,
Properties configProps)
manages the DataSourceFactories.
|
protected ScheduledExecutorService |
getScheduledExecutorService()
Get the scheduler service
|
protected TableState |
getTableState(String tableName)
Get a table state for a given table name
|
void |
initialize()
Initialize this factory
|
void |
setScheduledExecutorService(ScheduledExecutorService scheduledExecutor)
Inject an instance of a central ScheduledExecutorService
|
getName, setName
protected ScheduledExecutorService scheduler
protected static final String POOL_CONFIGURATION_PREFIX
protected static final String ATTRIBUTE_PREFIX
public JDBCDiskCacheFactory()
public <K,V> JDBCDiskCache<K,V> createCache(AuxiliaryCacheAttributes rawAttr, ICompositeCacheManager compositeCacheManager, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer) throws SQLException
createCache
in interface AuxiliaryCacheFactory
rawAttr
- specific cache configuration attributescompositeCacheManager
- the global cache managercacheEventLogger
- a specific logger for cache eventselementSerializer
- a serializer for cache elementsSQLException
- if the cache instance could not be createdpublic void initialize()
initialize
in interface AuxiliaryCacheFactory
initialize
in class AbstractAuxiliaryCacheFactory
public void dispose()
dispose
in interface AuxiliaryCacheFactory
dispose
in class AbstractAuxiliaryCacheFactory
protected TableState getTableState(String tableName)
tableName
- public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutor)
IRequireScheduler
setScheduledExecutorService
in interface IRequireScheduler
IRequireScheduler.setScheduledExecutorService(java.util.concurrent.ScheduledExecutorService)
protected ScheduledExecutorService getScheduledExecutorService()
protected void createShrinkerWhenNeeded(JDBCDiskCacheAttributes cattr, JDBCDiskCache<?,?> raf)
cattr
- raf
- protected DataSourceFactory getDataSourceFactory(JDBCDiskCacheAttributes cattr, Properties configProps) throws SQLException
cattr
- the cache configurationconfigProps
- the configuration properties objectSQLException
- if a database access error occursCopyright © 2002–2018 The Apache Software Foundation. All rights reserved.