|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bankframe.services.cache.TimeoutCachePolicy
public class TimeoutCachePolicy
This class implements a time-out based caching policy. Any entry in the cache that has not been accessed within the time-out period is removed. This policy supports the following configurable properties:
timeOut A long value specifiying in seconds how long entries should be kept in cache
| Constructor Summary | |
|---|---|
TimeoutCachePolicy()
Default Constructor |
|
TimeoutCachePolicy(long timeOut)
This constructor builds a timeout cache policy with the given timeout value |
|
| Method Summary | |
|---|---|
Set |
cleanup()
This method returns a set containing the keys of values that have expired. |
void |
configure(BankFrameResource config)
|
long |
getTimeOut()
|
boolean |
isCacheEntryValid(Object key,
Object value)
This method determines if the specified entry should be removed from the cache |
void |
remove(Object key)
This method signals the entry has been removed from the cache |
void |
remove(Set keySet)
This method signals the set of entries has been removed from the cache |
void |
removeAll()
This method signals that all entries have been removed from the cache |
void |
setTimeOut(long l)
|
void |
updateCacheEntries(Map values)
This method updates all the specified values |
void |
updateCacheEntry(Object key,
Object value)
This method updates the last access time for the specified entry |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TimeoutCachePolicy()
public TimeoutCachePolicy(long timeOut)
timeOut - the number of miliseconds before a cache entry invalidates| Method Detail |
|---|
public Set cleanup()
cleanup in interface CachePolicy
public boolean isCacheEntryValid(Object key,
Object value)
isCacheEntryValid in interface CachePolicykey - the key from of object to checkvalue - the value of the object to check
public void remove(Object key)
remove in interface CachePolicykey - the key of the entry to remove from the meta datapublic void remove(Set keySet)
remove in interface CachePolicykeySet - a set of keys to remove from the metadatapublic void removeAll()
removeAll in interface CachePolicypublic void updateCacheEntries(Map values)
updateCacheEntries in interface CachePolicyvalues - a map of values to update
public void updateCacheEntry(Object key,
Object value)
updateCacheEntry in interface CachePolicykey - the key of the cache entry to updatevalue - the value for this keypublic void configure(BankFrameResource config)
configure in interface ConfigurableCachePolicypublic long getTimeOut()
public void setTimeOut(long l)
l -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||