|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bankframe.services.cache.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 | |
java.util.Set |
cleanup()
This method returns a set containing the keys of values that have expired. |
void |
configure(BankFrameResource config)
|
long |
getTimeOut()
|
boolean |
isCacheEntryValid(java.lang.Object key,
java.lang.Object value)
This method determines if the specified entry should be removed from the cache |
void |
remove(java.lang.Object key)
This method signals the entry has been removed from the cache |
void |
remove(java.util.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(java.util.Map values)
This method updates all the specified values |
void |
updateCacheEntry(java.lang.Object key,
java.lang.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)
Method Detail |
public java.util.Set cleanup()
cleanup
in interface CachePolicy
public boolean isCacheEntryValid(java.lang.Object key, java.lang.Object value)
isCacheEntryValid
in interface CachePolicy
key
- the key from of object to checkvalue
- the value of the object to check
public void remove(java.lang.Object key)
remove
in interface CachePolicy
key
- the key of the entry to remove from the meta datapublic void remove(java.util.Set keySet)
remove
in interface CachePolicy
public void removeAll()
removeAll
in interface CachePolicy
public void updateCacheEntries(java.util.Map values)
updateCacheEntries
in interface CachePolicy
values
- a map of values to updatepublic void updateCacheEntry(java.lang.Object key, java.lang.Object value)
updateCacheEntry
in interface CachePolicy
key
- the key of the cache entry to updatevalue
- the value for this keypublic void configure(BankFrameResource config)
configure
in interface ConfigurableCachePolicy
public long getTimeOut()
public void setTimeOut(long l)
l
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |