Public Member Functions | |
ResultCacheEntry (SelectRequest request, ControllerResultSet result) | |
abstract String | getType () |
String | getState () |
boolean | isValid () |
boolean | isDirty () |
SelectRequest | getRequest () |
ControllerResultSet | getResult () |
void | setResult (ControllerResultSet result) |
abstract void | invalidate () |
void | markDirty () |
void | setValid () |
CacheEntry | getNext () |
void | setNext (CacheEntry next) |
CacheEntry | getPrev () |
void | setPrev (CacheEntry prev) |
abstract String[] | toStringTable () |
int | getSizeOfResult () |
Protected Attributes | |
SelectRequest | request |
ControllerResultSet | result |
int | state |
CacheEntry
represents a SQL select request with its reponse. The cache entry can have 3 states:
CACHE_VALID
when it is valid CACHE_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)
Definition at line 46 of file ResultCacheEntry.java.
|
Creates a new
Definition at line 61 of file ResultCacheEntry.java. 00062 { 00063 this.request = request; 00064 this.result = result; 00065 state = CACHE_VALID; 00066 next = null; 00067 prev = null; 00068 }
|
|
Gets the value of next
Implements org.objectweb.cjdbc.controller.cache.result.entries.CacheEntry. Definition at line 177 of file ResultCacheEntry.java. Referenced by org.objectweb.cjdbc.controller.cache.result.ResultCache.getFromCache(), and org.objectweb.cjdbc.controller.cache.result.ResultCache.removeFromCache(). 00178 {
00179 return next;
00180 }
|
|
Gets the value of previous
Implements org.objectweb.cjdbc.controller.cache.result.entries.CacheEntry. Definition at line 197 of file ResultCacheEntry.java. Referenced by org.objectweb.cjdbc.controller.cache.result.ResultCache.getFromCache(), and org.objectweb.cjdbc.controller.cache.result.ResultCache.removeFromCache(). 00198 {
00199 return prev;
00200 }
|
|
Returns the
Implements org.objectweb.cjdbc.controller.cache.result.entries.CacheEntry. Definition at line 119 of file ResultCacheEntry.java. Referenced by org.objectweb.cjdbc.controller.cache.result.ResultCache.getFromCache(), org.objectweb.cjdbc.controller.cache.result.schema.CacheDatabaseTable.invalidateAllExceptPk(), org.objectweb.cjdbc.controller.cache.result.ResultCacheColumnUnique.processAddToCache(), org.objectweb.cjdbc.controller.cache.result.threads.RelaxedCacheThread.run(), and org.objectweb.cjdbc.controller.cache.result.threads.EagerCacheThread.run(). 00120 {
00121 return request;
00122 }
|
|
Returns the
Implements org.objectweb.cjdbc.controller.cache.result.entries.CacheEntry. Definition at line 129 of file ResultCacheEntry.java. Referenced by org.objectweb.cjdbc.controller.cache.result.ResultCache.getFromCache(), org.objectweb.cjdbc.controller.cache.result.ResultCacheColumnUnique.isUpdateNecessary(), and org.objectweb.cjdbc.controller.cache.result.ResultCacheColumnUnique.processWriteNotify(). 00130 {
00131 return result;
00132 }
|
|
Size of the result in bytes
Implements org.objectweb.cjdbc.controller.cache.result.entries.CacheEntry. Definition at line 224 of file ResultCacheEntry.java. Referenced by org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed.toStringTable(), and org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryEager.toStringTable(). 00225 { 00226 try 00227 { 00228 return CJDBCStream.countBytes(result); 00229 } 00230 catch (Exception e) 00231 { 00232 return -1; 00233 } 00234 }
|
|
Get the state of this entry as a string
Implements org.objectweb.cjdbc.controller.cache.result.entries.CacheEntry. Definition at line 82 of file ResultCacheEntry.java. References org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntry.isDirty(), and org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntry.isValid(). Referenced by org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed.toStringTable(), and org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryEager.toStringTable(). 00083 { 00084 if (isValid()) 00085 return "Valid"; 00086 if (isDirty()) 00087 return "Dirty"; 00088 else 00089 return "Invalid"; 00090 }
|
|
Get the type of this entry as a string
Implements org.objectweb.cjdbc.controller.cache.result.entries.CacheEntry. Implemented in org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryEager, org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryNoCache, and org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed. |
|
|
Returns
Implements org.objectweb.cjdbc.controller.cache.result.entries.CacheEntry. Definition at line 109 of file ResultCacheEntry.java. Referenced by org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntry.getState(), and org.objectweb.cjdbc.controller.cache.result.threads.RelaxedCacheThread.run(). 00110 {
00111 return state == CACHE_DIRTY;
00112 }
|
|
Return
Implements org.objectweb.cjdbc.controller.cache.result.entries.CacheEntry. Definition at line 98 of file ResultCacheEntry.java. Referenced by org.objectweb.cjdbc.controller.cache.result.ResultCache.getFromCache(), org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntry.getState(), org.objectweb.cjdbc.controller.cache.result.ResultCacheColumnUnique.isUpdateNecessary(), and org.objectweb.cjdbc.controller.cache.result.ResultCacheColumnUnique.processAddToCache(). 00099 {
00100 return state == CACHE_VALID;
00101 }
|
|
Marks this entry dirty (state becomes CACHE_DIRTY).
The Implements org.objectweb.cjdbc.controller.cache.result.entries.CacheEntry. Definition at line 159 of file ResultCacheEntry.java. 00160 { 00161 state = CACHE_DIRTY; 00162 }
|
|
Sets the value of next
Implements org.objectweb.cjdbc.controller.cache.result.entries.CacheEntry. Definition at line 187 of file ResultCacheEntry.java. Referenced by org.objectweb.cjdbc.controller.cache.result.ResultCache.getFromCache(), and org.objectweb.cjdbc.controller.cache.result.ResultCache.removeFromCache(). 00188 {
00189 this.next = next;
00190 }
|
|
Sets the value of previous
Implements org.objectweb.cjdbc.controller.cache.result.entries.CacheEntry. Definition at line 207 of file ResultCacheEntry.java. Referenced by org.objectweb.cjdbc.controller.cache.result.ResultCache.getFromCache(), and org.objectweb.cjdbc.controller.cache.result.ResultCache.removeFromCache(). 00208 {
00209 this.prev = prev;
00210 }
|
|
Set a new The cache state is automatically set to valid (CACHE_VALID).
Implements org.objectweb.cjdbc.controller.cache.result.entries.CacheEntry. Definition at line 142 of file ResultCacheEntry.java. Referenced by org.objectweb.cjdbc.controller.cache.result.ResultCache.removeFromCache(). 00143 {
00144 this.result = result;
00145 state = CACHE_VALID;
00146 }
|
|
Marks this entry valid (state becomes CACHE_VALID). Implements org.objectweb.cjdbc.controller.cache.result.entries.CacheEntry. Definition at line 167 of file ResultCacheEntry.java. 00168 { 00169 state = CACHE_VALID; 00170 }
|
|
Get data about this entry
Implements org.objectweb.cjdbc.controller.cache.result.entries.CacheEntry. Implemented in org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryEager, org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryNoCache, and org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed. Referenced by org.objectweb.cjdbc.controller.cache.result.ResultCache.getCacheData(). |