|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.objectweb.cjdbc.controller.cache.QueryCacheEntry
A CacheEntry represents a SQL select request with
its reponse. The cache entry can have 3 states:
CACHE_VALID when it is validCACHE_DIRTY when the result has been marked dirty (may be
invalid)CACHE_INVALID when there is no result (request has to be
re-issued to the database)
| Field Summary | |
private static int |
CACHE_DIRTY
|
private static int |
CACHE_INVALID
|
private static int |
CACHE_VALID
|
private QueryCacheEntry |
next
|
private QueryCacheEntry |
prev
|
private SelectRequest |
request
|
private java.sql.ResultSet |
result
|
private int |
state
|
| Constructor Summary | |
QueryCacheEntry(SelectRequest request,
java.sql.ResultSet result)
Creates a new CacheEntry instance. |
|
| Method Summary | |
QueryCacheEntry |
getNext()
Gets the value of next QueryCacheEntry in LRU. |
QueryCacheEntry |
getPrev()
Gets the value of previous QueryCacheEntry in LRU. |
SelectRequest |
getRequest()
Returns the SELECT request of this cache entry. |
java.sql.ResultSet |
getResult()
Returns the ResultSet of the cached select request |
void |
invalidate()
Invalidates this cache entry (removes the ResultSet and
turn state to CACHE_INVALID). |
boolean |
isDirty()
Returns true if cache entry state is marked dirty (state is
CACHE_DIRTY). |
boolean |
isValid()
Return true if cache entry state is valid (state is
CACHE_VALID). |
void |
markDirty()
Marks this entry dirty (state becomes CACHE_DIRTY).
|
void |
setNext(QueryCacheEntry next)
Sets the value of next QueryCacheEntry in LRU. |
void |
setPrev(QueryCacheEntry prev)
Sets the value of previous QueryCacheEntry in LRU. |
void |
setResult(java.sql.ResultSet result)
Set a new ResultSet of the cached select
request (cache update). |
void |
setValid()
Marks this entry valid (state becomes CACHE_VALID). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private SelectRequest request
private java.sql.ResultSet result
private int state
private QueryCacheEntry next
private QueryCacheEntry prev
private static final int CACHE_VALID
private static final int CACHE_DIRTY
private static final int CACHE_INVALID
| Constructor Detail |
public QueryCacheEntry(SelectRequest request,
java.sql.ResultSet result)
CacheEntry instance.
request - a SelectRequest valueresult - a ResultSet value| Method Detail |
public boolean isValid()
true if cache entry state is valid (state is
CACHE_VALID).
boolean valuepublic boolean isDirty()
true if cache entry state is marked dirty (state is
CACHE_DIRTY).
boolean valuepublic SelectRequest getRequest()
SELECT request of this cache entry.
SelectRequest valuepublic java.sql.ResultSet getResult()
ResultSet of the cached select request
ResultSet valuepublic void setResult(java.sql.ResultSet result)
ResultSet of the cached select
request (cache update).
The cache state is automatically set to valid (CACHE_VALID).
result - a ResultSet valuepublic void invalidate()
ResultSet and
turn state to CACHE_INVALID).
public void markDirty()
CACHE_DIRTY).
The ResultSet if not affected by this method.
public void setValid()
CACHE_VALID).
public QueryCacheEntry getNext()
QueryCacheEntry in LRU.
public void setNext(QueryCacheEntry next)
QueryCacheEntry in LRU.
next - value to assign to next.public QueryCacheEntry getPrev()
QueryCacheEntry in LRU.
public void setPrev(QueryCacheEntry prev)
QueryCacheEntry in LRU.
prev - value to assign to prev.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||