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

java.lang.Object
  extended by org.apache.jcs.auxiliary.disk.AbstractDiskCacheManager
      extended by org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCacheManagerAbstractTemplate
          extended by org.apache.jcs.auxiliary.disk.jdbc.mysql.MySQLDiskCacheManager
All Implemented Interfaces:
java.io.Serializable, AuxiliaryCacheManager, ICacheType

public class MySQLDiskCacheManager
extends JDBCDiskCacheManagerAbstractTemplate

This manages instances of the MySQL jdbc disk cache. It maintains one for each region. One for all regions would work, but this gives us more detailed stats by region.

Although the generic JDBC Disk Cache Manager can be used for MySQL, the MySQL JDBC Disk Cache has additional features, such as table optimization that are particular to MySQL.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCacheManagerAbstractTemplate
caches, clients, tableStates
 
Fields inherited from interface org.apache.jcs.engine.behavior.ICacheType
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE
 
Method Summary
protected  AuxiliaryCache createJDBCDiskCache(JDBCDiskCacheAttributes cattr, TableState tableState)
          Creates a JDBCDiskCache using the supplied attributes.
 AuxiliaryCache getCache(java.lang.String cacheName)
          Gets the cache attribute of the HSQLCacheManager object
protected  ICompositeCacheManager getCompositeCacheManager()
           
 MySQLDiskCacheAttributes getDefaultJDBCDiskCacheAttributes()
          Gets the defaultCattr attribute of the HSQLCacheManager object
static MySQLDiskCacheManager getInstance(MySQLDiskCacheAttributes cattr, ICompositeCacheManager compositeCacheManager, ICacheEventLogger cacheEventLogger, IElementSerializer elementSerializer)
          Gets the instance attribute of the HSQLCacheManager class
protected  void scheduleOptimization(java.util.Date startTime, MySQLTableOptimizer optimizer)
          This takes in a single time and schedules the optimizer to be called at that time every day.
protected  void scheduleOptimizations(MySQLDiskCacheAttributes attributes, TableState tableState, JDBCDiskCachePoolAccess poolAccess)
          For each time in the optimization schedule, this calls schedule Optimizaiton.
protected  void setCompositeCacheManager(ICompositeCacheManager compositeCacheManager)
           
 
Methods inherited from class org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCacheManagerAbstractTemplate
createShrinkerWhenNeeded, freeCache, getCache, getCacheType, release
 
Methods inherited from class org.apache.jcs.auxiliary.disk.AbstractDiskCacheManager
getCacheEventLogger, getElementSerializer, setCacheEventLogger, setElementSerializer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDefaultJDBCDiskCacheAttributes

public MySQLDiskCacheAttributes getDefaultJDBCDiskCacheAttributes()
Gets the defaultCattr attribute of the HSQLCacheManager object

Returns:
The defaultCattr value

getInstance

public static MySQLDiskCacheManager getInstance(MySQLDiskCacheAttributes cattr,
                                                ICompositeCacheManager compositeCacheManager,
                                                ICacheEventLogger cacheEventLogger,
                                                IElementSerializer elementSerializer)
Gets the instance attribute of the HSQLCacheManager class

Parameters:
cattr -
compositeCacheManager -
cacheEventLogger -
elementSerializer -
Returns:
The instance value

getCache

public AuxiliaryCache getCache(java.lang.String cacheName)
Gets the cache attribute of the HSQLCacheManager object

Parameters:
cacheName -
Returns:
The cache value

createJDBCDiskCache

protected AuxiliaryCache createJDBCDiskCache(JDBCDiskCacheAttributes cattr,
                                             TableState tableState)
Creates a JDBCDiskCache using the supplied attributes.

Specified by:
createJDBCDiskCache in class JDBCDiskCacheManagerAbstractTemplate
Parameters:
cattr -
tableState -
Returns:
AuxiliaryCache

setCompositeCacheManager

protected void setCompositeCacheManager(ICompositeCacheManager compositeCacheManager)
Parameters:
compositeCacheManager - the compositeCacheManager to set

getCompositeCacheManager

protected ICompositeCacheManager getCompositeCacheManager()
Returns:
the compositeCacheManager

scheduleOptimizations

protected void scheduleOptimizations(MySQLDiskCacheAttributes attributes,
                                     TableState tableState,
                                     JDBCDiskCachePoolAccess poolAccess)
For each time in the optimization schedule, this calls schedule Optimizaiton.

Parameters:
attributes - configuration propeties.
tableState - for noting optimization in progress, etc.
poolAccess - access to the pool

scheduleOptimization

protected void scheduleOptimization(java.util.Date startTime,
                                    MySQLTableOptimizer optimizer)
This takes in a single time and schedules the optimizer to be called at that time every day.

Parameters:
startTime - -- HH:MM:SS format
optimizer -


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