|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bankframe.ei.txnhandler.hostcache.TimeoutMemoryCache
com.bankframe.serives.cache package instead
public class TimeoutMemoryCache
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:
- public void store(Map pkOfEntitiesToDataPacketResponses,long timeOut)
- public void store(Map pkOfEntitiesToDataPacketResponses,long timeOut, boolean persistent)
- public boolean checkPrimaryKeyInCache(DataPacket primaryKeyOfEntity)
- public DataPacket retrieve(DataPacket primaryKeyOfEntity)
- public Vector remove(Vector pkOfEntitiesToRemove)
- public Vector remove(Vector pkOfEntitiesToRemove,boolean persistent)
| 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. |
Vector |
remove(Vector pkOfEntitiesToRemove)
Deprecated. Equivalent to remove(pks, false) |
Vector |
remove(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(Map pkOfEntitiesToDataPacketResponses)
Deprecated. Equivalent to store(pk, false) |
void |
store(Map pkOfEntitiesToDataPacketResponses,
boolean persistent)
Deprecated. Store many entries in the cache at once. |
void |
store(Map pkOfEntitiesToDataPacketResponses,
long timeOut)
Deprecated. This method is equivalent to store(pk,timeOut, false); |
void |
store(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 |
|---|
public static boolean trace
| Method Detail |
|---|
public void store(Map pkOfEntitiesToDataPacketResponses,
long timeOut)
throws ProcessingErrorException
store in interface TimeoutCachepkOfEntitiesToDataPacketResponses - Map containg key value pairs of primary key and entity DataPacketstimeOut - The length of time (in milliseconds) to cache the data.
ProcessingErrorException - If there was an exception thrown in the execution of the method.
public void store(Map pkOfEntitiesToDataPacketResponses,
long timeOut,
boolean persistent)
throws ProcessingErrorException
store in interface TimeoutCachepkOfEntitiesToDataPacketResponses - Map containg key value pairs of primary key and entity DataPacketstimeOut - 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.
ProcessingErrorException - If there was an exception thrown in the execution of the method.
public boolean checkPrimaryKeyInCache(DataPacket primaryKeyOfEntity)
throws ProcessingErrorException
checkPrimaryKeyInCache in interface TimeoutCacheprimaryKeyOfEntity - The primary key of the entity to check against.
ProcessingErrorException - If there was an exception thrown in the execution of the method.
public boolean checkPrimaryKeyInCache(DataPacket primaryKeyOfEntity,
long timeOutValue)
throws ProcessingErrorException
Cache
checkPrimaryKeyInCache in interface CacheprimaryKeyOfEntity - The primary key of the entity to check against.timeOutValue - The maximum time a cache entry can be valid.
ProcessingErrorException - If there was an exception thrown in the execution of the method.Cache.checkPrimaryKeyInCache(DataPacket, long)
public DataPacket retrieve(DataPacket primaryKeyOfEntity)
throws ProcessingErrorException
Cache
retrieve in interface CacheprimaryKeyOfEntity - The primary key of the cached entity to be retrieved.
ProcessingErrorException - If there was an exception thrown in the execution of the method.Cache.retrieve(DataPacket)
public void store(Map pkOfEntitiesToDataPacketResponses)
throws ProcessingErrorException
Cache
store in interface CachepkOfEntitiesToDataPacketResponses - Self explanatory.
ProcessingErrorException - If there was an exception thrown in the execution of the method.Cache.store(Map)
public void store(Map pkOfEntitiesToDataPacketResponses,
boolean persistent)
throws ProcessingErrorException
Cachestore in interface CachepkOfEntitiesToDataPacketResponses - Self explanitory.persistent - If this is true the pair will be written to the database and upon restart it will be availiable again.
ProcessingErrorException - If there was an exception thrown in the execution of the method.Cache.store(Map, boolean)
public Vector remove(Vector pkOfEntitiesToRemove)
throws ProcessingErrorException
Cache
remove in interface CachepkOfEntitiesToRemove - The entries to remove.
ProcessingErrorException - If there was an exception thrown in the execution of the method.Cache.remove(Vector)
public Vector remove(Vector pkOfEntitiesToRemove,
boolean persistanceTableToo)
throws ProcessingErrorException
Cache
remove in interface CachepkOfEntitiesToRemove - The entries to remove.persistanceTableToo - If true the entry will be purged from the persistance table.
ProcessingErrorException - If there was an exception thrown in the execution of the method.Cache.remove(Vector, boolean)
public void open()
throws ProcessingErrorException
Cache
open in interface CacheProcessingErrorException - If there was an exception thrown in the execution of the method.Cache.open()
public void close()
throws ProcessingErrorException
Cache
close in interface CacheProcessingErrorException - If there was an exception thrown in the execution of the method.Cache.close()public int maxMemCacheSize()
Profile
maxMemCacheSize in interface ProfileProfile.maxMemCacheSize()public int maxDbCacheSize()
Profile
maxDbCacheSize in interface ProfileProfile.maxDbCacheSize()
public int numberEntriesInMemCache()
throws ProcessingErrorException
Profile
numberEntriesInMemCache in interface ProfileProcessingErrorException - If there was an exception thrown in the execution of the method.Profile.numberEntriesInMemCache()
public int numberEntriesInDbCache()
throws ProcessingErrorException
Profile
numberEntriesInDbCache in interface ProfileProcessingErrorException - If there was an exception thrown in the execution of the method.Profile.numberEntriesInDbCache()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||