|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jrun.sql.pool.SQLCache
Simple query cache that refreshes itself asynchronously. Can be disabled and its timing configured by params in the jrun-resource file.
| Field Summary | |
protected java.lang.Thread |
cachechecker
|
protected int |
max_size
|
protected long |
sleeptime
|
| Constructor Summary | |
SQLCache(JDBCPool pool)
|
|
SQLCache(JDBCPool pool,
int size,
int sleeptimeSecs)
|
|
| Method Summary | |
boolean |
cacheResult(java.lang.String origsql,
java.sql.ResultSet results)
Cache a result. |
void |
forceRefresh()
Refresh the cache explicitly. |
int |
getMaxSize()
Return the maximum possible size of the cache. |
JDBCPool |
getPool()
Retrieve the JDBCPool to which this SQLCache corresponds. |
java.util.Hashtable |
getRawCache()
Return the current cache as a Hashtable. |
java.sql.ResultSet |
getResult(java.lang.String sql)
Get a cached SQL Result. |
boolean |
removeResult(java.lang.String sql)
Remove a cached SQLResult. |
void |
run()
|
void |
setPool(JDBCPool pool)
Establish the JDBCPool to which this SQLCache corresponds. |
int |
size()
Return the size of the cache as an integer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected long sleeptime
protected int max_size
protected java.lang.Thread cachechecker
| Constructor Detail |
public SQLCache(JDBCPool pool)
public SQLCache(JDBCPool pool,
int size,
int sleeptimeSecs)
| Method Detail |
public java.util.Hashtable getRawCache()
public JDBCPool getPool()
public void setPool(JDBCPool pool)
public java.sql.ResultSet getResult(java.lang.String sql)
public boolean removeResult(java.lang.String sql)
public boolean cacheResult(java.lang.String origsql,
java.sql.ResultSet results)
public int size()
public int getMaxSize()
public void forceRefresh()
public void run()
run in interface java.lang.Runnable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||