| java.lang.Object net.sourceforge.jtds.jdbc.cache.ProcedureCache
ProcedureCache | public class ProcedureCache implements StatementCache(Code) | | LRU cache for procedures and statement handles.
version: $Id: ProcedureCache.java,v 1.5 2005/07/05 16:44:25 alin_sinpalean Exp $ |
Field Summary | |
int | cacheSize Maximum cache size or 0 to disable. | ArrayList | free List of redundant cache entries. | CacheEntry | head Head node of the linked list. | CacheEntry | tail Tail node of the linked list. |
Constructor Summary | |
public | ProcedureCache(int cacheSize) Constructs a new statement cache. |
Method Summary | |
public synchronized Object | get(String key) Retrieves a ProcEntry object from the cache. | public synchronized Collection | getObsoleteHandles(Collection handles) Obtains a list of statement handles or procedures that can now be
dropped. | public synchronized void | put(String key, Object handle) Inserts a new entry, identified by a key, into the cache. | public synchronized void | remove(String key) Removes a redundant entry from the cache. |
cacheSize | int cacheSize(Code) | | Maximum cache size or 0 to disable.
|
head | CacheEntry head(Code) | | Head node of the linked list.
|
tail | CacheEntry tail(Code) | | Tail node of the linked list.
|
ProcedureCache | public ProcedureCache(int cacheSize)(Code) | | Constructs a new statement cache.
Parameters: cacheSize - maximum cache size or 0 to disable caching |
get | public synchronized Object get(String key)(Code) | | Retrieves a ProcEntry object from the cache.
If the entry exists it is moved to the front of the linked list to keep
it alive as long as possible.
Parameters: key - the key value identifying the required entry the keyed entry as an Object or null if the entrydoes not exist |
getObsoleteHandles | public synchronized Collection getObsoleteHandles(Collection handles)(Code) | | Obtains a list of statement handles or procedures that can now be
dropped.
Parameters: handles - a collection of single use statements that will bereturned for dropping if the cache is disabled the collection of redundant statments for dropping |
put | public synchronized void put(String key, Object handle)(Code) | | Inserts a new entry, identified by a key, into the cache.
If the cache is full then one or more entries are removed and
transferred to a list for later destruction.
Parameters: key - value used to identify the entry Parameters: handle - proc entry to be inserted into the cache |
remove | public synchronized void remove(String key)(Code) | | Removes a redundant entry from the cache.
Parameters: key - value that identifies the cache entry |
|
|