|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.cjdbc.controller.cache.result.entries.AbstractResultCacheEntry
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 | |
static int |
CACHE_DIRTY
This entry is dirty |
static int |
CACHE_INVALID
This entry is no more valid and is not consistent with real data. |
static int |
CACHE_VALID
State this entry is valid |
private AbstractResultCacheEntry |
next
|
static int |
NO_DEADLINE
This entry has no deadline |
private AbstractResultCacheEntry |
prev
|
protected SelectRequest |
request
|
protected ControllerResultSet |
result
|
protected int |
state
|
Constructor Summary | |
AbstractResultCacheEntry(SelectRequest request,
ControllerResultSet result)
Creates a new CacheEntry instance. |
Method Summary | |
AbstractResultCacheEntry |
getNext()
Gets the value of next AbstractResultCacheEntry in LRU. |
AbstractResultCacheEntry |
getPrev()
Gets the value of previous AbstractResultCacheEntry 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 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(AbstractResultCacheEntry next)
Sets the value of next AbstractResultCacheEntry in LRU. |
void |
setPrev(AbstractResultCacheEntry prev)
Sets the value of previous AbstractResultCacheEntry 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 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 AbstractResultCacheEntry next
private AbstractResultCacheEntry prev
public static final int NO_DEADLINE
public static final int CACHE_VALID
public static final int CACHE_DIRTY
public static final int CACHE_INVALID
Constructor Detail |
public AbstractResultCacheEntry(SelectRequest request, ControllerResultSet result)
CacheEntry
instance.
request
- a SelectRequest
valueresult
- a ControllerResultSet
valueMethod Detail |
public abstract java.lang.String getType()
public java.lang.String getState()
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 ControllerResultSet getResult()
ControllerResultSet
of the cached select request
ControllerResultSet
valuepublic void setResult(ControllerResultSet result)
ControllerResultSet
of the cached select request
(cache update).
The cache state is automatically set to valid (CACHE_VALID
).
result
- a ControllerResultSet
valuepublic abstract 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 AbstractResultCacheEntry getNext()
AbstractResultCacheEntry
in LRU.
public void setNext(AbstractResultCacheEntry next)
AbstractResultCacheEntry
in LRU.
next
- value to assign to next.public AbstractResultCacheEntry getPrev()
AbstractResultCacheEntry
in LRU.
public void setPrev(AbstractResultCacheEntry prev)
AbstractResultCacheEntry
in LRU.
prev
- value to assign to prev.public abstract java.lang.String[] toStringTable()
public int getSizeOfResult()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |