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 Cache
key
- key whose mapping entry is to be checked.public void addToCache(CacheObjectKey key, Object o, boolean force)
addToCache
in interface Cache
key
- 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 Cache
public void flushCache()
Cache
flushCache
in interface Cache
public void purge()
Cache
public void purge(Object obj)
Cache
public int getSize()
public int getMaxSize()
public boolean isSynchronized()
Cache
isSynchronized
in interface Cache
Copyright © 2019. All rights reserved.