Class JDBCDiskCacheFactory
java.lang.Object
org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheFactory
org.apache.commons.jcs3.auxiliary.disk.jdbc.JDBCDiskCacheFactory
- All Implemented Interfaces:
- AuxiliaryCacheFactory,- IRequireScheduler
- Direct Known Subclasses:
- HSQLDiskCacheFactory,- MySQLDiskCacheFactory
public class JDBCDiskCacheFactory
extends AbstractAuxiliaryCacheFactory
implements IRequireScheduler
This factory should create JDBC auxiliary caches.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final String.attributesprotected static final Stringprops prefixprotected ScheduledExecutorServiceThe background scheduler, one for all regions.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription<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 voidcreateShrinkerWhenNeeded(JDBCDiskCacheAttributes cattr, JDBCDiskCache<?, ?> raf) If UseDiskShrinker is true then we will create a shrinker daemon if necessary.voiddispose()Dispose of this factory, clean up shared resourcesprotected DataSourceFactorygetDataSourceFactory(JDBCDiskCacheAttributes cattr, Properties configProps) manages the DataSourceFactories.protected ScheduledExecutorServiceGet the scheduler serviceprotected TableStategetTableState(String tableName) Get a table state for a given table namevoidInitialize this factoryvoidsetScheduledExecutorService(ScheduledExecutorService scheduledExecutor) Inject an instance of a central ScheduledExecutorServiceMethods inherited from class org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheFactorygetName, setName
- 
Field Details- 
schedulerThe background scheduler, one for all regions. Injected by the configurator
- 
POOL_CONFIGURATION_PREFIXprops prefix- See Also:
 
- 
ATTRIBUTE_PREFIX.attributes- See Also:
 
 
- 
- 
Constructor Details- 
JDBCDiskCacheFactorypublic JDBCDiskCacheFactory()
 
- 
- 
Method Details- 
createCachepublic <K,V> JDBCDiskCache<K,V> createCache(AuxiliaryCacheAttributes rawAttr, ICompositeCacheManager compositeCacheManager, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer) throws SQLException This factory method should create an instance of the jdbc cache.- Specified by:
- createCachein interface- AuxiliaryCacheFactory
- Parameters:
- rawAttr- specific cache configuration attributes
- compositeCacheManager- the global cache manager
- cacheEventLogger- a specific logger for cache events
- elementSerializer- a serializer for cache elements
- Returns:
- JDBCDiskCache the cache instance
- Throws:
- SQLException- if the cache instance could not be created
 
- 
initializeInitialize this factory- Specified by:
- initializein interface- AuxiliaryCacheFactory
 
- 
disposeDispose of this factory, clean up shared resources- Specified by:
- disposein interface- AuxiliaryCacheFactory
 
- 
getTableStateGet a table state for a given table name- Parameters:
- tableName-
- Returns:
- a cached instance of the table state
 
- 
setScheduledExecutorServiceDescription copied from interface:IRequireSchedulerInject an instance of a central ScheduledExecutorService- Specified by:
- setScheduledExecutorServicein interface- IRequireScheduler
- See Also:
 
- 
getScheduledExecutorServiceGet the scheduler service- Returns:
- the scheduler
 
- 
createShrinkerWhenNeededIf UseDiskShrinker is true then we will create a shrinker daemon if necessary.- Parameters:
- cattr-
- raf-
 
- 
getDataSourceFactoryprotected DataSourceFactory getDataSourceFactory(JDBCDiskCacheAttributes cattr, Properties configProps) throws SQLException manages the DataSourceFactories.- Parameters:
- cattr- the cache configuration
- configProps- the configuration properties object
- Returns:
- a DataSourceFactory
- Throws:
- SQLException- if a database access error occurs
 
 
-