com.bankframe.services.cache
Class MergedDataPacketsCache

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

public class MergedDataPacketsCache
extends GenericCache

The class is a specialisation of the GenericCache class. When a put() or putAll() method is invoked where the values are DataPackets then if a matching key already exists then the old DataPacket value and the new DataPacket value are merged.

Where a field in the DataPacket exists in both the old and the new version the old value of the field is overwritten with the new value of the field.

With GenericCache the old DataPacket value is simply overwritten with the new value.

To configure a cache to use this Cache implementation adjust the cache.cacheName.class setting in the BankframeResource.properties file This cache can only be used to store DataPacket data.

For example to change the txnPersister cache to use this cache implementation use the following setting: cache.txnPersister.class=com.bankframe.services.cache.MergedDataPacketsCache

Author:
cdivilly

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Constructor Summary
MergedDataPacketsCache()
          Default Constructor
MergedDataPacketsCache(CachePolicy policy)
           
MergedDataPacketsCache(java.util.Map persistentMap)
           
MergedDataPacketsCache(java.util.Map persistentMap, CachePolicy policy)
           
 
Method Summary
 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.
 
Methods inherited from class com.bankframe.services.cache.GenericCache
cleanup, clear, containsKey, containsValue, enableCaching, entrySet, equals, get, getCachePolicy, getFromPersistentMap, getName, getPersistentMap, hashCode, isEmpty, keySet, remove, remove, removeAll, setCachePolicy, setName, setPersistentMap, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MergedDataPacketsCache

public MergedDataPacketsCache()
Default Constructor


MergedDataPacketsCache

public MergedDataPacketsCache(CachePolicy policy)
Parameters:
policy -

MergedDataPacketsCache

public MergedDataPacketsCache(java.util.Map persistentMap)
Parameters:
persistentMap -

MergedDataPacketsCache

public MergedDataPacketsCache(java.util.Map persistentMap,
                              CachePolicy policy)
Parameters:
persistentMap -
policy -
Method Detail

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 GenericCache
Parameters:
key - Unique key identifying the object
value - The object

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 GenericCache


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