com.bankframe.ei.txnhandler.hostcache
Class TimeoutMemoryCache

java.lang.Object
  extended bycom.bankframe.ei.txnhandler.hostcache.TimeoutMemoryCache
All Implemented Interfaces:
Cache, Profile, TimeoutCache

Deprecated. Use the com.bankframe.serives.cache package instead

public class TimeoutMemoryCache
extends java.lang.Object
implements TimeoutCache

This class implements a timeout based cache that caches data in memory only. This cache attempts to limit the cache to the value specified by maxMemCache at all times. It does this by removing unwanted entries from the cache on each call to the following methods:


Field Summary
static boolean trace
          Deprecated.  
 
Method Summary
 boolean checkPrimaryKeyInCache(DataPacket primaryKeyOfEntity)
          Deprecated. This method checks to see if the specified key is in the cache.
 boolean checkPrimaryKeyInCache(DataPacket primaryKeyOfEntity, long timeOutValue)
          Deprecated. This method checks to see if the specified key is in the cache.
 void close()
          Deprecated. Closes the connection to the database.
 int maxDbCacheSize()
          Deprecated. This method returns the max allowed size of database cache.
 int maxMemCacheSize()
          Deprecated. This method returns the max allowed size of the memory cache.
 int numberEntriesInDbCache()
          Deprecated. This method returns the number of elements currently in the database cache.
 int numberEntriesInMemCache()
          Deprecated. This method returns the number of elements currently in the memory cache.
 void open()
          Deprecated. Opens the connection to the database.
 java.util.Vector remove(java.util.Vector pkOfEntitiesToRemove)
          Deprecated. Equivalent to remove(pks, false)
 java.util.Vector remove(java.util.Vector pkOfEntitiesToRemove, boolean persistanceTableToo)
          Deprecated. Removes all the entries of the Vector in the Cache.
 DataPacket retrieve(DataPacket primaryKeyOfEntity)
          Deprecated. Retrieve a response from the cache by primary key.
 void store(java.util.Map pkOfEntitiesToDataPacketResponses)
          Deprecated. Equivalent to store(pk, false)
 void store(java.util.Map pkOfEntitiesToDataPacketResponses, boolean persistent)
          Deprecated. Store many entries in the cache at once.
 void store(java.util.Map pkOfEntitiesToDataPacketResponses, long timeOut)
          Deprecated. This method is equivalent to store(pk,timeOut, false);
 void store(java.util.Map pkOfEntitiesToDataPacketResponses, long timeOut, boolean persistent)
          Deprecated. This method stores many entries in the cache at once.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

trace

public static boolean trace
Deprecated. 
Method Detail

store

public void store(java.util.Map pkOfEntitiesToDataPacketResponses,
                  long timeOut)
           throws ProcessingErrorException
Deprecated. 
This method is equivalent to store(pk,timeOut, false);

Specified by:
store in interface TimeoutCache
Parameters:
pkOfEntitiesToDataPacketResponses - Map containg key value pairs of primary key and entity DataPackets
timeOut - The length of time (in milliseconds) to cache the data.
Throws:
ProcessingErrorException - If there was an exception thrown in the execution of the method.

store

public void store(java.util.Map pkOfEntitiesToDataPacketResponses,
                  long timeOut,
                  boolean persistent)
           throws ProcessingErrorException
Deprecated. 
This method stores many entries in the cache at once. For each key, k the following must be true: encoder_.encode(k).length()
Specified by:
store in interface TimeoutCache
Parameters:
pkOfEntitiesToDataPacketResponses - Map containg key value pairs of primary key and entity DataPackets
timeOut - The length of time (in milliseconds) to cache the data.
persistent - If this is true the pair will be written to the database and upon restart it will be availiable again.
Throws:
ProcessingErrorException - If there was an exception thrown in the execution of the method.

checkPrimaryKeyInCache

public boolean checkPrimaryKeyInCache(DataPacket primaryKeyOfEntity)
                               throws ProcessingErrorException
Deprecated. 
This method checks to see if the specified key is in the cache.

Specified by:
checkPrimaryKeyInCache in interface TimeoutCache
Parameters:
primaryKeyOfEntity - The primary key of the entity to check against.
Returns:
false if the entry is not in the cache or is timed out. Otherwise it returns true.
Throws:
ProcessingErrorException - If there was an exception thrown in the execution of the method.

checkPrimaryKeyInCache

public boolean checkPrimaryKeyInCache(DataPacket primaryKeyOfEntity,
                                      long timeOutValue)
                               throws ProcessingErrorException
Deprecated. 
Description copied from interface: Cache
This method checks to see if the specified key is in the cache.

Specified by:
checkPrimaryKeyInCache in interface Cache
Parameters:
primaryKeyOfEntity - The primary key of the entity to check against.
timeOutValue - The maximum time a cache entry can be valid.
Returns:
false if the entry is not in the cache or is timed out. Otherwise it returns true.
Throws:
ProcessingErrorException - If there was an exception thrown in the execution of the method.
See Also:
Cache.checkPrimaryKeyInCache(DataPacket, long)

retrieve

public DataPacket retrieve(DataPacket primaryKeyOfEntity)
                    throws ProcessingErrorException
Deprecated. 
Description copied from interface: Cache
Retrieve a response from the cache by primary key.

Specified by:
retrieve in interface Cache
Parameters:
primaryKeyOfEntity - The primary key of the cached entity to be retrieved.
Returns:
The cached response as a DataPacket. If the key doesn't exist or is invalid (due to a timeout, et cetera) this will return null.
Throws:
ProcessingErrorException - If there was an exception thrown in the execution of the method.
See Also:
Cache.retrieve(DataPacket)

store

public void store(java.util.Map pkOfEntitiesToDataPacketResponses)
           throws ProcessingErrorException
Deprecated. 
Description copied from interface: Cache
Equivalent to store(pk, false)

Specified by:
store in interface Cache
Parameters:
pkOfEntitiesToDataPacketResponses - Self explanatory.
Throws:
ProcessingErrorException - If there was an exception thrown in the execution of the method.
See Also:
Cache.store(Map)

store

public void store(java.util.Map pkOfEntitiesToDataPacketResponses,
                  boolean persistent)
           throws ProcessingErrorException
Deprecated. 
Description copied from interface: Cache
Store many entries in the cache at once. For each key, k the following must be true: encoder_.encode(k).length()
Specified by:
store in interface Cache
Parameters:
pkOfEntitiesToDataPacketResponses - Self explanitory.
persistent - If this is true the pair will be written to the database and upon restart it will be availiable again.
Throws:
ProcessingErrorException - If there was an exception thrown in the execution of the method.
See Also:
Cache.store(Map, boolean)

remove

public java.util.Vector remove(java.util.Vector pkOfEntitiesToRemove)
                        throws ProcessingErrorException
Deprecated. 
Description copied from interface: Cache
Equivalent to remove(pks, false)

Specified by:
remove in interface Cache
Parameters:
pkOfEntitiesToRemove - The entries to remove.
Returns:
A vector of the keys removed.
Throws:
ProcessingErrorException - If there was an exception thrown in the execution of the method.
See Also:
Cache.remove(Vector)

remove

public java.util.Vector remove(java.util.Vector pkOfEntitiesToRemove,
                               boolean persistanceTableToo)
                        throws ProcessingErrorException
Deprecated. 
Description copied from interface: Cache
Removes all the entries of the Vector in the Cache.

Specified by:
remove in interface Cache
Parameters:
pkOfEntitiesToRemove - The entries to remove.
persistanceTableToo - If true the entry will be purged from the persistance table.
Returns:
A vector of the keys removed.
Throws:
ProcessingErrorException - If there was an exception thrown in the execution of the method.
See Also:
Cache.remove(Vector, boolean)

open

public void open()
          throws ProcessingErrorException
Deprecated. 
Description copied from interface: Cache
Opens the connection to the database.

Specified by:
open in interface Cache
Throws:
ProcessingErrorException - If there was an exception thrown in the execution of the method.
See Also:
Cache.open()

close

public void close()
           throws ProcessingErrorException
Deprecated. 
Description copied from interface: Cache
Closes the connection to the database.

Specified by:
close in interface Cache
Throws:
ProcessingErrorException - If there was an exception thrown in the execution of the method.
See Also:
Cache.close()

maxMemCacheSize

public int maxMemCacheSize()
Deprecated. 
Description copied from interface: Profile
This method returns the max allowed size of the memory cache.

Specified by:
maxMemCacheSize in interface Profile
Returns:
int max size of cache.
See Also:
Profile.maxMemCacheSize()

maxDbCacheSize

public int maxDbCacheSize()
Deprecated. 
Description copied from interface: Profile
This method returns the max allowed size of database cache.

Specified by:
maxDbCacheSize in interface Profile
Returns:
int max size of cache.
See Also:
Profile.maxDbCacheSize()

numberEntriesInMemCache

public int numberEntriesInMemCache()
                            throws ProcessingErrorException
Deprecated. 
Description copied from interface: Profile
This method returns the number of elements currently in the memory cache.

Specified by:
numberEntriesInMemCache in interface Profile
Returns:
int The number of elements currently in the cache.
Throws:
ProcessingErrorException - If there was an exception thrown in the execution of the method.
See Also:
Profile.numberEntriesInMemCache()

numberEntriesInDbCache

public int numberEntriesInDbCache()
                           throws ProcessingErrorException
Deprecated. 
Description copied from interface: Profile
This method returns the number of elements currently in the database cache.

Specified by:
numberEntriesInDbCache in interface Profile
Returns:
int The number of elements currently in the cache.
Throws:
ProcessingErrorException - If there was an exception thrown in the execution of the method.
See Also:
Profile.numberEntriesInDbCache()


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