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.MyCacheListener
Nested 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 int
Removed 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 void
processUpdate
(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, toString
Methods 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, update
Methods inherited from class org.apache.commons.jcs3.auxiliary.AbstractAuxiliaryCacheEventLogging
disposeWithEventLogging, getMatchingWithEventLogging, getMultiple, getMultipleWithEventLogging, getWithEventLogging, removeAllWithEventLogging, removeWithEventLogging, updateWithEventLogging
Methods 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:
processGet
in 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:
processGetMatching
in classJDBCDiskCache<K,
V> - Parameters:
pattern
- used for like query.- Returns:
- An object matching key, or null.
-
constructLikeParameterFromPattern
- Overrides:
constructLikeParameterFromPattern
in 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:
processUpdate
in 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:
deleteExpired
in classJDBCDiskCache<K,
V> - Returns:
- the number deleted
-