com.bankframe.services.cache.threadcleaned
Class ThreadCleanedJMSCache

java.lang.Object
  extended bycom.bankframe.services.cache.GenericCache
      extended bycom.bankframe.services.cache.threadcleaned.ThreadCleanedCache
          extended bycom.bankframe.services.cache.threadcleaned.ThreadCleanedJMSCache
All Implemented Interfaces:
Cache, JMSCache, java.util.Map, NamedCache, PersistentCache

public class ThreadCleanedJMSCache
extends ThreadCleanedCache
implements JMSCache

The ThreadCleanedJMSCache class provides generic caching functionality using a distributed cache within a multi-JVM environment. The cleaning up of this cache is performed by the ThreadCleanedGenericCacheStartUp class.


Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Constructor Summary
ThreadCleanedJMSCache()
           
 
Method Summary
 void cleanup()
          This method cleans up the cache by removing un-needed entries
 void clear()
          This method clears the cache.
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 void enableCaching(boolean enableCache)
          This method enables or disables caching.
 boolean equals(java.lang.Object o)
           
 java.lang.Object get(java.lang.Object key)
          This method retrieves the specified object, if it is not in the cacheit will be fetched from the data store.
 CachePolicy getCachePolicy()
          This method gets the CachePolicy object for this Cache
 int hashCode()
           
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          This method updates the specified object to the data-store.
 void putAll(java.util.Map values)
          This method places the specified values in the cache and the data-store.
 java.lang.Object remove(java.lang.Object key)
          This method removes the specified object from the cache and the data store.
 void remove(java.util.Set keySet)
          This method removes the specified keys from the cache and the data store
 void removeAll()
          Removes all objects from the cache and from the data store.
 void removeAllDontSend()
           
 java.lang.Object removeDontSend(java.lang.Object key)
           
 void removeDontSend(java.util.Set keySet)
           
 void setCachePolicy(CachePolicy policy)
          This method sets the CachePolicy object for this Cache
 
Methods inherited from class com.bankframe.services.cache.GenericCache
addCacheListener, entrySet, getFromPersistentMap, getName, getPersistentMap, isEmpty, keySet, removeCacheListener, setName, setPersistentMap, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.bankframe.services.cache.Cache
addCacheListener, removeCacheListener
 
Methods inherited from interface java.util.Map
entrySet, isEmpty, keySet, size, values
 

Constructor Detail

ThreadCleanedJMSCache

public ThreadCleanedJMSCache()
Method Detail

setCachePolicy

public void setCachePolicy(CachePolicy policy)
Description copied from interface: Cache
This method sets the CachePolicy object for this Cache

Specified by:
setCachePolicy in interface Cache
Overrides:
setCachePolicy in class GenericCache
Parameters:
policy - The new cache policy

removeAllDontSend

public void removeAllDontSend()
Specified by:
removeAllDontSend in interface JMSCache

removeDontSend

public java.lang.Object removeDontSend(java.lang.Object key)
Specified by:
removeDontSend in interface JMSCache

removeDontSend

public void removeDontSend(java.util.Set keySet)
Specified by:
removeDontSend in interface JMSCache

get

public java.lang.Object get(java.lang.Object key)
Description copied from class: GenericCache
This method retrieves the specified object, if it is not in the cacheit will be fetched from the data store.

Specified by:
get in interface java.util.Map
Overrides:
get in class ThreadCleanedCache

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Description copied from class: GenericCache
This method updates the specified object to the data-store. It also updates the reference stored in the cache. If the object does not exist in the data-store it will be created.

Specified by:
put in interface java.util.Map
Overrides:
put in class ThreadCleanedCache

putAll

public void putAll(java.util.Map values)
Description copied from class: GenericCache
This method places the specified values in the cache and the data-store. :param values a map of values to add to the cache.

Specified by:
putAll in interface java.util.Map
Overrides:
putAll in class ThreadCleanedCache

remove

public java.lang.Object remove(java.lang.Object key)
Description copied from class: GenericCache
This method removes the specified object from the cache and the data store.

Specified by:
remove in interface java.util.Map
Overrides:
remove in class ThreadCleanedCache

remove

public void remove(java.util.Set keySet)
Description copied from interface: Cache
This method removes the specified keys from the cache and the data store

Specified by:
remove in interface Cache
Overrides:
remove in class ThreadCleanedCache

cleanup

public void cleanup()
Description copied from interface: Cache
This method cleans up the cache by removing un-needed entries

Specified by:
cleanup in interface Cache
Overrides:
cleanup in class GenericCache

clear

public void clear()
Description copied from class: GenericCache
This method clears the cache. Does not remove entries from the persistent map

Specified by:
clear in interface java.util.Map
Overrides:
clear in class GenericCache

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map
Overrides:
containsKey in class GenericCache
See Also:
Invokes this.get(Object key) and checks if value returned is null. This will ensure that if an entry exists and a cache policy is used, the entry timeout will be updated so it is available for use again.

containsValue

public boolean containsValue(java.lang.Object value)
Specified by:
containsValue in interface java.util.Map
Overrides:
containsValue in class GenericCache
See Also:
Note that the cache may contain the value, but the key may have expired and is due to be removed. This means that the cache may not have the value the next time this method is called.

enableCaching

public void enableCaching(boolean enableCache)
Description copied from interface: Cache
This method enables or disables caching. When caching is disabled the cache passes all operations on to the persistent map instance

Specified by:
enableCaching in interface Cache
Overrides:
enableCaching in class GenericCache
Parameters:
enableCache - true to enable, false to disable

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Map
Overrides:
equals in class GenericCache
See Also:
Map

getCachePolicy

public CachePolicy getCachePolicy()
Description copied from interface: Cache
This method gets the CachePolicy object for this Cache

Specified by:
getCachePolicy in interface Cache
Overrides:
getCachePolicy in class GenericCache
Returns:
CachePolicy instance or null if there is no CachePolicy

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.Map
Overrides:
hashCode in class GenericCache
See Also:
Map

removeAll

public void removeAll()
Description copied from interface: Cache
Removes all objects from the cache and from the data store. Use this method with caution!

Specified by:
removeAll in interface Cache
Overrides:
removeAll in class GenericCache


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