|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.jcs.auxiliary.disk.AbstractDiskCache
org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache
Disk cache that uses a RandomAccessFile with keys stored in memory
| Nested Class Summary |
| Nested classes inherited from class org.apache.jcs.auxiliary.disk.AbstractDiskCache |
|
| Field Summary | |
(package private) IndexedDiskCacheAttributes |
cattr
|
private IndexedDisk |
dataFile
|
private java.lang.String |
fileName
|
private IndexedDisk |
keyFile
|
private java.util.HashMap |
keyHash
|
private static org.apache.commons.logging.Log |
log
|
private java.io.File |
rafDir
|
protected ReadWriteLock |
storageLock
Each instance of a Disk cache should use this lock to synchronize reads and writes to the underlying storage mechansism. |
| Fields inherited from class org.apache.jcs.auxiliary.disk.AbstractDiskCache |
alive, cacheEventQueue, cacheName, lock, locker, purgatory, purgHits |
| Fields inherited from interface org.apache.jcs.engine.behavior.ICacheType |
CACHE_HUB, DISK_CACHE, LATERAL_CACHE, REMOTE_CACHE |
| Constructor Summary | |
IndexedDiskCache(IndexedDiskCacheAttributes cattr)
Constructor for the DiskCache object |
|
| Method Summary | |
void |
doDispose()
Description of the Method |
protected ICacheElement |
doGet(java.io.Serializable key)
Get a value from the persistent store. |
boolean |
doRemove(java.io.Serializable key)
Returns true if the removal was succesful; or false if there is nothing to remove. |
void |
doRemoveAll()
Description of the Method |
void |
doUpdate(ICacheElement ce)
Update the disk cache. |
void |
dump()
For debugging. |
java.util.Set |
getGroupKeys(java.lang.String groupName)
Gets the set of keys of objects currently in the group |
int |
getSize()
Returns the current cache size. |
private void |
loadKeys()
Description of the Method |
private void |
optimizeFile()
Note: synchronization currently managed by the only caller method - dispose. |
private CacheElement |
readElement(java.io.Serializable key)
|
private void |
reset()
handle error by last resort, force content update, or removeall |
private void |
saveKeys()
Saves key file to disk |
| Methods inherited from class org.apache.jcs.auxiliary.disk.AbstractDiskCache |
dispose, get, getCacheName, getCacheType, getStatus, remove, removeAll, update |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final org.apache.commons.logging.Log log
private java.lang.String fileName
private IndexedDisk dataFile
private IndexedDisk keyFile
private java.util.HashMap keyHash
private java.io.File rafDir
IndexedDiskCacheAttributes cattr
protected ReadWriteLock storageLock
| Constructor Detail |
public IndexedDiskCache(IndexedDiskCacheAttributes cattr)
cattr - | Method Detail |
private void loadKeys()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionprivate void saveKeys()
public void doUpdate(ICacheElement ce)
doUpdate in class AbstractDiskCacheprotected ICacheElement doGet(java.io.Serializable key)
AbstractDiskCache
doGet in class AbstractDiskCachekey - Key to locate value for.
AbstractDiskCache.doGet(java.io.Serializable)
private CacheElement readElement(java.io.Serializable key)
throws java.lang.Exception
java.lang.Exceptionpublic java.util.Set getGroupKeys(java.lang.String groupName)
AuxiliaryCache
getGroupKeys in interface AuxiliaryCachegetGroupKeys in class AbstractDiskCachepublic boolean doRemove(java.io.Serializable key)
doRemove in class AbstractDiskCachekey -
public void doRemoveAll()
doRemoveAll in class AbstractDiskCacheprivate void reset()
public void doDispose()
doDispose in class AbstractDiskCacheprivate void optimizeFile()
public int getSize()
getSize in interface AuxiliaryCachegetSize in class AbstractDiskCacheICache#getSizepublic void dump()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||