Class MySQLDiskCacheFactory
java.lang.Object
org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheFactory
org.apache.commons.jcs3.auxiliary.disk.jdbc.JDBCDiskCacheFactory
org.apache.commons.jcs3.auxiliary.disk.jdbc.mysql.MySQLDiskCacheFactory
- All Implemented Interfaces:
AuxiliaryCacheFactory,IRequireScheduler
This factory should create mysql disk caches.
-
Field Summary
Fields inherited from class org.apache.commons.jcs3.auxiliary.disk.jdbc.JDBCDiskCacheFactory
ATTRIBUTE_PREFIX, POOL_CONFIGURATION_PREFIX, scheduler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<K,V> MySQLDiskCache<K, V> createCache(AuxiliaryCacheAttributes rawAttr, ICompositeCacheManager compositeCacheManager, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer) This factory method should create an instance of the mysqlcache.protected voidscheduleOptimization(Date startTime, MySQLTableOptimizer optimizer) This takes in a single time and schedules the optimizer to be called at that time every day.protected voidscheduleOptimizations(MySQLDiskCacheAttributes attributes, TableState tableState, DataSource ds) For each time in the optimization schedule, this calls schedule Optimization.Methods inherited from class org.apache.commons.jcs3.auxiliary.disk.jdbc.JDBCDiskCacheFactory
createShrinkerWhenNeeded, dispose, getDataSourceFactory, getScheduledExecutorService, getTableState, initialize, setScheduledExecutorServiceMethods inherited from class org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheFactory
getName, setName
-
Constructor Details
-
MySQLDiskCacheFactory
public MySQLDiskCacheFactory()
-
-
Method Details
-
createCache
public <K,V> MySQLDiskCache<K,V> createCache(AuxiliaryCacheAttributes rawAttr, ICompositeCacheManager compositeCacheManager, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer) throws SQLException This factory method should create an instance of the mysqlcache.- Specified by:
createCachein interfaceAuxiliaryCacheFactory- Overrides:
createCachein classJDBCDiskCacheFactory- Parameters:
rawAttr- specific cache configuration attributescompositeCacheManager- the global cache managercacheEventLogger- a specific logger for cache eventselementSerializer- a serializer for cache elements- Returns:
- MySQLDiskCache the cache instance
- Throws:
SQLException- if the cache instance could not be created
-
scheduleOptimizations
protected void scheduleOptimizations(MySQLDiskCacheAttributes attributes, TableState tableState, DataSource ds) For each time in the optimization schedule, this calls schedule Optimization.- Parameters:
attributes- configuration properties.tableState- for noting optimization in progress, etc.ds- the DataSource
-
scheduleOptimization
This takes in a single time and schedules the optimizer to be called at that time every day.- Parameters:
startTime- -- HH:MM:SS formatoptimizer-
-