|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntry
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 CacheEntry |
next
|
private CacheEntry |
prev
|
protected SelectRequest |
request
|
protected ControllerResultSet |
result
|
protected int |
state
|
| Fields inherited from interface org.objectweb.cjdbc.controller.cache.result.entries.CacheEntry |
CACHE_DIRTY, CACHE_INVALID, CACHE_VALID, NO_DEADLINE |
| Constructor Summary | |
ResultCacheEntry(SelectRequest request,
ControllerResultSet result)
Creates a new CacheEntry instance. |
|
| Method Summary | |
CacheEntry |
getNext()
Gets the value of next ResultCacheEntry in LRU. |
CacheEntry |
getPrev()
Gets the value of previous ResultCacheEntry in LRU. |
SelectRequest |
getRequest()
Returns the SELECT request of this cache entry. |
ControllerResultSet |
getResult()
Returns the ControllerResultSet of the cached select request |
int |
getSizeOfResult()
Size of the result in bytes |
java.lang.String |
getState()
Get the state of this entry as a string |
abstract java.lang.String |
getType()
Get the type of this entry as a string |
abstract void |
invalidate()
Invalidates this cache entry (removes the ResultSet and turn
state to CacheEntry.CACHE_INVALID). |
boolean |
isDirty()
Returns true if cache entry state is marked dirty (state is
CacheEntry.CACHE_DIRTY). |
boolean |
isValid()
Return true if cache entry state is valid (state is
CacheEntry.CACHE_VALID). |
void |
markDirty()
Marks this entry dirty (state becomes CacheEntry.CACHE_DIRTY).
|
void |
setNext(CacheEntry next)
Sets the value of next ResultCacheEntry in LRU. |
void |
setPrev(CacheEntry prev)
Sets the value of previous ResultCacheEntry in LRU. |
void |
setResult(ControllerResultSet result)
Set a new ControllerResultSet of the cached select request
(cache update).
|
void |
setValid()
Marks this entry valid (state becomes CacheEntry.CACHE_VALID). |
abstract java.lang.String[] |
toStringTable()
Get data about this entry |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected SelectRequest request
protected ControllerResultSet result
protected int state
private CacheEntry next
private CacheEntry prev
| Constructor Detail |
public ResultCacheEntry(SelectRequest request,
ControllerResultSet result)
CacheEntry instance.
request - a SelectRequest valueresult - a ControllerResultSet value| Method Detail |
public abstract java.lang.String getType()
getType in interface CacheEntrypublic java.lang.String getState()
getState in interface CacheEntrypublic boolean isValid()
true if cache entry state is valid (state is
CacheEntry.CACHE_VALID).
isValid in interface CacheEntryboolean valuepublic boolean isDirty()
true if cache entry state is marked dirty (state is
CacheEntry.CACHE_DIRTY).
isDirty in interface CacheEntryboolean valuepublic SelectRequest getRequest()
SELECT request of this cache entry.
getRequest in interface CacheEntrySelectRequest valuepublic ControllerResultSet getResult()
ControllerResultSet of the cached select request
getResult in interface CacheEntryControllerResultSet valuepublic void setResult(ControllerResultSet result)
ControllerResultSet of the cached select request
(cache update).
The cache state is automatically set to valid (CacheEntry.CACHE_VALID).
setResult in interface CacheEntryresult - a ControllerResultSet valuepublic abstract void invalidate()
ResultSet and turn
state to CacheEntry.CACHE_INVALID).
invalidate in interface CacheEntrypublic void markDirty()
CacheEntry.CACHE_DIRTY).
The ResultSet if not affected by this method.
markDirty in interface CacheEntrypublic void setValid()
CacheEntry.CACHE_VALID).
setValid in interface CacheEntrypublic CacheEntry getNext()
ResultCacheEntry in LRU.
getNext in interface CacheEntrypublic void setNext(CacheEntry next)
ResultCacheEntry in LRU.
setNext in interface CacheEntrynext - value to assign to next.public CacheEntry getPrev()
ResultCacheEntry in LRU.
getPrev in interface CacheEntrypublic void setPrev(CacheEntry prev)
ResultCacheEntry in LRU.
setPrev in interface CacheEntryprev - value to assign to prev.public abstract java.lang.String[] toStringTable()
toStringTable in interface CacheEntrypublic int getSizeOfResult()
getSizeOfResult in interface CacheEntry
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||