Class MySQLDiskCache<K,V>
java.lang.Object
org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCache<K,V>
org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheEventLogging<K,V>
org.apache.commons.jcs3.auxiliary.disk.AbstractDiskCache<K,V>
org.apache.commons.jcs3.auxiliary.disk.jdbc.JDBCDiskCache<K,V>
org.apache.commons.jcs3.auxiliary.disk.jdbc.mysql.MySQLDiskCache<K,V>
- All Implemented Interfaces:
AuxiliaryCache<K,,V> ICache<K,,V> ICacheType
The MySQLDiskCache extends the core JDBCDiskCache.
Although the generic JDBC Disk Cache can be used for MySQL, the MySQL JDBC Disk Cache has additional features, such as table optimization that are particular to MySQL.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.commons.jcs3.auxiliary.disk.AbstractDiskCache
AbstractDiskCache.MyCacheListenerNested classes/interfaces inherited from interface org.apache.commons.jcs3.engine.behavior.ICacheType
ICacheType.CacheType -
Field Summary
Fields inherited from interface org.apache.commons.jcs3.engine.behavior.ICache
NAME_COMPONENT_DELIMITER -
Constructor Summary
ConstructorsConstructorDescriptionMySQLDiskCache(MySQLDiskCacheAttributes attributes, DataSourceFactory dsFactory, TableState tableState) Delegates to the super and makes use of the MySQL specific parameters used for scheduled optimization. -
Method Summary
Modifier and TypeMethodDescriptionconstructLikeParameterFromPattern(String pattern) protected intRemoved the expired.protected ICacheElement<K,V> processGet(K key) This delegates to the generic JDBC disk cache.protected Map<K,ICacheElement<K, V>> processGetMatching(String pattern) This delegates to the generic JDBC disk cache.protected voidprocessUpdate(ICacheElement<K, V> element) This delegates to the generic JDBC disk cache.Methods inherited from class org.apache.commons.jcs3.auxiliary.disk.jdbc.JDBCDiskCache
doesElementExist, getAuxiliaryCacheAttributes, getDataSource, getDiskLocation, getJdbcDiskCacheAttributes, getKeySet, getSize, getStatistics, getTableName, getTableState, processDispose, processRemove, processRemoveAll, reset, setJdbcDiskCacheAttributes, setTableState, toStringMethods inherited from class org.apache.commons.jcs3.auxiliary.disk.AbstractDiskCache
dispose, doDispose, doGet, doGetMatching, doRemove, doRemoveAll, doUpdate, get, getCacheName, getCacheType, getEventLoggingExtraInfo, getMatching, getStats, getStatus, isAlive, remove, removeAll, setAlive, updateMethods inherited from class org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheEventLogging
disposeWithEventLogging, getMatchingWithEventLogging, getMultiple, getMultipleWithEventLogging, getWithEventLogging, removeAllWithEventLogging, removeWithEventLogging, updateWithEventLoggingMethods inherited from class org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCache
createICacheEvent, createICacheEvent, getCacheEventLogger, getElementSerializer, getKeyMatcher, logApplicationEvent, logError, logICacheEvent, processGetMultiple, setCacheEventLogger, setElementSerializer, setKeyMatcher
-
Constructor Details
-
MySQLDiskCache
public MySQLDiskCache(MySQLDiskCacheAttributes attributes, DataSourceFactory dsFactory, TableState tableState) throws SQLException Delegates to the super and makes use of the MySQL specific parameters used for scheduled optimization.- Parameters:
attributes- the configuration object for this cachedsFactory- the DataSourceFactory for this cachetableState- an object to track table operations- Throws:
SQLException- if the pool access could not be set up
-
-
Method Details
-
processGet
This delegates to the generic JDBC disk cache. If we are currently optimizing, then this method will balk and return null.- Overrides:
processGetin classJDBCDiskCache<K,V> - Parameters:
key- Key to locate value for.- Returns:
- An object matching key, or null.
- See Also:
-
processGetMatching
This delegates to the generic JDBC disk cache. If we are currently optimizing, then this method will balk and return null.- Overrides:
processGetMatchingin classJDBCDiskCache<K,V> - Parameters:
pattern- used for like query.- Returns:
- An object matching key, or null.
-
constructLikeParameterFromPattern
- Overrides:
constructLikeParameterFromPatternin classJDBCDiskCache<K,V> - Parameters:
pattern-- Returns:
- String to use in the like query.
-
processUpdate
This delegates to the generic JDBC disk cache. If we are currently optimizing, then this method will balk and do nothing.- Overrides:
processUpdatein classJDBCDiskCache<K,V> - Parameters:
element-
-
deleteExpired
Removed the expired. (now - create time) > max life seconds * 1000If we are currently optimizing, then this method will balk and do nothing.
TODO consider blocking and trying again.
- Overrides:
deleteExpiredin classJDBCDiskCache<K,V> - Returns:
- the number deleted
-