com.bankframe.services.cache
Class NullPolicy

java.lang.Object
  extended bycom.bankframe.services.cache.NullPolicy
All Implemented Interfaces:
CachePolicy

public class NullPolicy
extends java.lang.Object
implements CachePolicy

The NullPolicy type. This policy object has no policy!. It always determines an entry to be valid and never provides any entries to be removed. Using this policy object with a Cache should be equivalent to using a standard Hashtable or HashMap object. Since this policy maintains no state and can never change, a single instance of this policy can be shared between all clients that need to use it. This instance is called NullPolicy.INSTANCE


Field Summary
static NullPolicy INSTANCE
          This is the single instance of this policy object
 
Method Summary
 java.util.Set cleanup()
          This method returns a set containing the keys of values that have expired.
 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 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
 

Field Detail

INSTANCE

public static final NullPolicy INSTANCE
This is the single instance of this policy object

Method Detail

cleanup

public java.util.Set cleanup()
Description copied from interface: CachePolicy
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

isCacheEntryValid

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

Specified by:
isCacheEntryValid in interface CachePolicy

remove

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

Specified by:
remove in interface CachePolicy

remove

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

Specified by:
remove in interface CachePolicy

removeAll

public void removeAll()
Description copied from interface: CachePolicy
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)
Description copied from interface: CachePolicy
This method updates all the specified values

Specified by:
updateCacheEntries in interface CachePolicy

updateCacheEntry

public void updateCacheEntry(java.lang.Object key,
                             java.lang.Object value)
Description copied from interface: CachePolicy
This method updates the last access time for the specified entry

Specified by:
updateCacheEntry in interface CachePolicy


Copyright © 2005, 2007, Oracle. All rights reserved.