public class LRUCacheImpl extends Object implements Cache
| Modifier and Type | Class and Description |
|---|---|
static class |
LRUCacheImpl.CacheEntry
Cache object that has an entry.
|
| Constructor and Description |
|---|
LRUCacheImpl(PoolInfo poolInfo,
int maxSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
addToCache(CacheObjectKey key,
Object o,
boolean force)
Add the key and entry value into the cache.
|
Object |
checkAndUpdateCache(CacheObjectKey key)
Check if an entry is found for this key object.
|
void |
clearCache()
Clears the statement cache
|
void |
flushCache()
Closing all statements in statement cache and flush the statement cache
of all the statements.
|
int |
getMaxSize() |
int |
getSize()
Returns the number of entries in the statement cache
|
boolean |
isSynchronized()
Check if the statement cache is synchronized.
|
void |
purge()
Remove all statements stored in the statement cache after closing
the statement objects.
|
void |
purge(Object obj)
Remove the specified entry stored in the statement cache after closing
the statement object associated with this entry.
|
protected static final Logger _logger
public LRUCacheImpl(PoolInfo poolInfo, int maxSize)
public Object checkAndUpdateCache(CacheObjectKey key)
checkAndUpdateCache in interface Cachekey - key whose mapping entry is to be checked.public void addToCache(CacheObjectKey key, Object o, boolean force)
addToCache in interface Cachekey - key that contains the sql string and its type (PS/CS)o - entry that is the wrapper of PreparedStatement or
CallableStatementforce - If the already existing key is to be overwrittenpublic void clearCache()
clearCache in interface Cachepublic void flushCache()
CacheflushCache in interface Cachepublic void purge()
Cachepublic void purge(Object obj)
Cachepublic int getSize()
public int getMaxSize()
public boolean isSynchronized()
CacheisSynchronized in interface CacheCopyright © 2017. All rights reserved.