|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.jonas.resource.internal.cm.sql.cache.AbstractPreparedStatementCacheImpl
org.ow2.jonas.resource.internal.cm.sql.cache.PreparedStatementMapCacheImpl
public class PreparedStatementMapCacheImpl
Map cache implementation A Pstmt key is used to index the entries A LinkedHashMap is used to implement the LRU algorithm when entries must be freed (no more space)
| Field Summary | |
|---|---|
Map<PreparedStatementMapCacheKey,List<PreparedStatementWrapper>> |
pStmts
Cache |
| Fields inherited from class org.ow2.jonas.resource.internal.cm.sql.cache.AbstractPreparedStatementCacheImpl |
|---|
cacheLogger, LOCAL_STATISTIC_KEY, maxPstmtCacheSize, pstmtCacheSize, stats |
| Fields inherited from interface org.ow2.jonas.resource.internal.cm.sql.cache.PreparedStatementCache |
|---|
CACHE_POLICY_LIST, CACHE_POLICY_MAP |
| Constructor Summary | |
|---|---|
PreparedStatementMapCacheImpl(int maxCacheSize,
PreparedStatementCacheStatistics pstmtStats,
org.objectweb.util.monolog.api.Logger logger)
Constructor |
|
| Method Summary | |
|---|---|
void |
close()
Close all the cache entries |
void |
destroy()
Destroy all the cache entries |
PreparedStatementWrapper |
get(PreparedStatementWrapper psw)
Retrieve an entry in the cache |
String |
getState(String prefix)
Dump the pstmt cache state |
void |
put(PreparedStatementWrapper psw)
Put a pstmt in the cache. |
void |
reallyClose()
Close all the cache entries |
| Methods inherited from class org.ow2.jonas.resource.internal.cm.sql.cache.AbstractPreparedStatementCacheImpl |
|---|
getMaxPstmtCacheSize, getPstmtCacheSize, setMaxPstmtCacheSize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.ow2.jonas.resource.internal.cm.sql.cache.PreparedStatementCache |
|---|
getMaxPstmtCacheSize, getPstmtCacheSize, setMaxPstmtCacheSize |
| Field Detail |
|---|
public Map<PreparedStatementMapCacheKey,List<PreparedStatementWrapper>> pStmts
| Constructor Detail |
|---|
public PreparedStatementMapCacheImpl(int maxCacheSize,
PreparedStatementCacheStatistics pstmtStats,
org.objectweb.util.monolog.api.Logger logger)
maxCacheSize - max cache sizelogger - trace logger| Method Detail |
|---|
public PreparedStatementWrapper get(PreparedStatementWrapper psw)
PreparedStatementCache
get in interface PreparedStatementCacheget in class AbstractPreparedStatementCacheImplpsw - : parameters of the prepared statement to retrieve
public void put(PreparedStatementWrapper psw)
throws CacheException,
SQLException
put in interface PreparedStatementCacheput in class AbstractPreparedStatementCacheImplpsw - prepared statement to add
CacheException - no more space in cache
SQLExceptionpublic String getState(String prefix)
AbstractPreparedStatementCacheImpl
getState in interface PreparedStatementCachegetState in class AbstractPreparedStatementCacheImplprefix - indentation
public void destroy()
destroy in interface PreparedStatementCachedestroy in class AbstractPreparedStatementCacheImplpublic void reallyClose()
reallyClose in interface PreparedStatementCachereallyClose in class AbstractPreparedStatementCacheImplpublic void close()
close in interface PreparedStatementCacheclose in class AbstractPreparedStatementCacheImpl
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||