org.apache.jcs.auxiliary.disk.jdbc.mysql
Class MySQLDiskCache

java.lang.Object
  extended by org.apache.jcs.auxiliary.disk.AbstractDiskCache
      extended by org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCache
          extended by org.apache.jcs.auxiliary.disk.jdbc.mysql.MySQLDiskCache
All Implemented Interfaces:
java.io.Serializable, AuxiliaryCache, ICache, ICacheType

public class MySQLDiskCache
extends JDBCDiskCache

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.

Author:
Aaron Smuts
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.jcs.auxiliary.disk.AbstractDiskCache
alive, cacheEventQueue, cacheName, purgatory, purgHits
 
Fields inherited from interface org.apache.jcs.engine.behavior.ICacheType
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE
 
Constructor Summary
MySQLDiskCache(MySQLDiskCacheAttributes attributes, TableState tableState)
          Delegates to the super and makes use of the MySQL specific parameters used for scheduled optimization.
 
Method Summary
protected  int deleteExpired()
          Removed the expired.
 ICacheElement doGet(java.io.Serializable key)
          This delegates to the generic JDBC disk cache.
 void doUpdate(ICacheElement element)
          This delegates to the generic JDBC disk cache.
 
Methods inherited from class org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCache
doDispose, doesElementExist, doRemove, doRemoveAll, getAuxiliaryCacheAttributes, getElementSerializer, getGroupKeys, getJdbcDiskCacheAttributes, getSize, getStatistics, getTableName, getTableState, initializePoolAccess, reset, serialize, setElementSerializer, setJdbcDiskCacheAttributes, setTableState, toString
 
Methods inherited from class org.apache.jcs.auxiliary.disk.AbstractDiskCache
dispose, get, getCacheName, getCacheType, getStats, getStatus, remove, removeAll, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MySQLDiskCache

public MySQLDiskCache(MySQLDiskCacheAttributes attributes,
                      TableState tableState)
Delegates to the super and makes use of the MySQL specific parameters used for scheduled optimization.

Parameters:
attributes -
tableState -
Method Detail

doGet

public ICacheElement doGet(java.io.Serializable key)
This delegates to the generic JDBC disk cache. If we are currently optimizing, then this method will balk and return null.

Overrides:
doGet in class JDBCDiskCache
Parameters:
key - Key to locate value for.
Returns:
An object matching key, or null.
See Also:
AbstractDiskCache.doGet(java.io.Serializable)

doUpdate

public void doUpdate(ICacheElement element)
This delegates to the generic JDBC disk cache. If we are currently optimizing, then this method will balk and do nothing.

Overrides:
doUpdate in class JDBCDiskCache
Parameters:
element -

deleteExpired

protected int deleteExpired()
Removed the expired. (now - create time) > max life seconds * 1000

If we are currently optimizing, then this method will balk and do nothing.

TODO consider blocking and trying again.

Overrides:
deleteExpired in class JDBCDiskCache
Returns:
the number deleted


Copyright © 2002-2007 Apache Software Foundation. All Rights Reserved.