solar.module.cache
Class RefreshableCache

java.lang.Object
  |
  +--java.util.TimerTask
        |
        +--solar.module.cache.BaseCache
              |
              +--solar.module.cache.RefreshableCache
All Implemented Interfaces:
Cache, CacheConstants, java.lang.Runnable

public class RefreshableCache
extends BaseCache

Objects in a refreshable cache can be refreshed by adding them again.

Version:
$Id: RefreshableCache.java,v 1.1 2003/10/04 01:49:27 glchen Exp $
Author:
Guanling Chen

Nested Class Summary
 
Nested classes inherited from class solar.module.cache.Cache
Cache.CacheListener
 
Field Summary
 
Fields inherited from class solar.module.cache.BaseCache
_cache, _capacity, _listeners, _size, _ttl
 
Fields inherited from class java.util.TimerTask
 
Fields inherited from interface solar.module.cache.CacheConstants
CACHE_CAPACITY_DEFAULT, CACHE_CAPACITY_INFINIT, CACHE_TTL_DEFAULT, CACHE_TTL_FOREVER
 
Constructor Summary
RefreshableCache()
           
RefreshableCache(int capacity, long ttl)
           
 
Method Summary
 void addObject(java.lang.Object objectId, java.lang.Object obj)
          Note if objectId exists in the cache, the previous cached object will be discarded and replaced by this one if they are different.
 
Methods inherited from class solar.module.cache.BaseCache
addListener, flush, getCachedObject, getCachedObjects, getCapacity, getObject, getObjectIds, getObjects, getSize, removeListener, removeObject, run
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RefreshableCache

public RefreshableCache()

RefreshableCache

public RefreshableCache(int capacity,
                        long ttl)
Method Detail

addObject

public void addObject(java.lang.Object objectId,
                      java.lang.Object obj)
               throws CacheException
Note if objectId exists in the cache, the previous cached object will be discarded and replaced by this one if they are different.

Specified by:
addObject in interface Cache
Overrides:
addObject in class BaseCache
CacheException