|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bankframe.ei.txnhandler.hostcache.TimeoutMemoryCache
com.bankframe.serives.cache
package instead
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. |
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 |
public static boolean trace
Method Detail |
public void store(java.util.Map pkOfEntitiesToDataPacketResponses, long timeOut) throws ProcessingErrorException
store
in interface TimeoutCache
pkOfEntitiesToDataPacketResponses
- 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(java.util.Map pkOfEntitiesToDataPacketResponses, long timeOut, boolean persistent) throws ProcessingErrorException
store
in interface TimeoutCache
pkOfEntitiesToDataPacketResponses
- 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 TimeoutCache
primaryKeyOfEntity
- 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 Cache
primaryKeyOfEntity
- 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 Cache
primaryKeyOfEntity
- 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(java.util.Map pkOfEntitiesToDataPacketResponses) throws ProcessingErrorException
Cache
store
in interface Cache
pkOfEntitiesToDataPacketResponses
- Self explanatory.
ProcessingErrorException
- If there was an exception thrown in the execution of the method.Cache.store(Map)
public void store(java.util.Map pkOfEntitiesToDataPacketResponses, boolean persistent) throws ProcessingErrorException
Cache
store
in interface Cache
pkOfEntitiesToDataPacketResponses
- 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 java.util.Vector remove(java.util.Vector pkOfEntitiesToRemove) throws ProcessingErrorException
Cache
remove
in interface Cache
pkOfEntitiesToRemove
- The entries to remove.
ProcessingErrorException
- If there was an exception thrown in the execution of the method.Cache.remove(Vector)
public java.util.Vector remove(java.util.Vector pkOfEntitiesToRemove, boolean persistanceTableToo) throws ProcessingErrorException
Cache
remove
in interface Cache
pkOfEntitiesToRemove
- 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 Cache
ProcessingErrorException
- If there was an exception thrown in the execution of the method.Cache.open()
public void close() throws ProcessingErrorException
Cache
close
in interface Cache
ProcessingErrorException
- If there was an exception thrown in the execution of the method.Cache.close()
public int maxMemCacheSize()
Profile
maxMemCacheSize
in interface Profile
Profile.maxMemCacheSize()
public int maxDbCacheSize()
Profile
maxDbCacheSize
in interface Profile
Profile.maxDbCacheSize()
public int numberEntriesInMemCache() throws ProcessingErrorException
Profile
numberEntriesInMemCache
in interface Profile
ProcessingErrorException
- If there was an exception thrown in the execution of the method.Profile.numberEntriesInMemCache()
public int numberEntriesInDbCache() throws ProcessingErrorException
Profile
numberEntriesInDbCache
in interface Profile
ProcessingErrorException
- 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 |