com.bankframe.services.cache
Class TimeoutCachePolicy

java.lang.Object
  extended bycom.bankframe.services.cache.TimeoutCachePolicy
All Implemented Interfaces:
CachePolicy, ConfigurableCachePolicy

public class TimeoutCachePolicy
extends java.lang.Object
implements ConfigurableCachePolicy

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:

Author:
Engineering

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

TimeoutCachePolicy

public TimeoutCachePolicy()
Default Constructor


TimeoutCachePolicy

public TimeoutCachePolicy(long timeOut)
This constructor builds a timeout cache policy with the given timeout value

Method Detail

cleanup

public java.util.Set cleanup()
This method returns a set containing the keys of values that have expired. If this method returns an empty set then there are no values to be removed. If this method returns a null value, then all values have expired

Specified by:
cleanup in interface CachePolicy
Returns:
set containing the keys

isCacheEntryValid

public boolean isCacheEntryValid(java.lang.Object key,
                                 java.lang.Object value)
This method determines if the specified entry should be removed from the cache

Specified by:
isCacheEntryValid in interface CachePolicy
Parameters:
key - the key from of object to check
value - the value of the object to check
Returns:
true if the entry has expired otherwise false

remove

public void remove(java.lang.Object key)
This method signals the entry has been removed from the cache

Specified by:
remove in interface CachePolicy
Parameters:
key - the key of the entry to remove from the meta data

remove

public void remove(java.util.Set keySet)
This method signals the set of entries has been removed from the cache

Specified by:
remove in interface CachePolicy

removeAll

public void removeAll()
This method signals that all entries have been removed from the cache

Specified by:
removeAll in interface CachePolicy

updateCacheEntries

public void updateCacheEntries(java.util.Map values)
This method updates all the specified values

Specified by:
updateCacheEntries in interface CachePolicy
Parameters:
values - a map of values to update

updateCacheEntry

public void updateCacheEntry(java.lang.Object key,
                             java.lang.Object value)
This method updates the last access time for the specified entry

Specified by:
updateCacheEntry in interface CachePolicy
Parameters:
key - the key of the cache entry to update
value - the value for this key

configure

public void configure(BankFrameResource config)
Specified by:
configure in interface ConfigurableCachePolicy

getTimeOut

public long getTimeOut()
Returns:

setTimeOut

public void setTimeOut(long l)
Parameters:
l -


Copyright © 2004 Siebel Systems, Inc. All rights reserved.