org.objectweb.cjdbc.controller.cache.result.entries
Class ResultCacheEntryRelaxed

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.cache.result.entries.AbstractResultCacheEntry
      extended byorg.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed

public class ResultCacheEntryRelaxed
extends AbstractResultCacheEntry

A CacheEntry that is to be recognized as Relaxed entry.

Version:
1.0
Author:
Nicolas Modrzyk , Emmanuel Cecchet

Field Summary
private  long deadline
           
private  boolean keepIfNotDirty
           
private  long timeout
           
 
Fields inherited from class org.objectweb.cjdbc.controller.cache.result.entries.AbstractResultCacheEntry
CACHE_DIRTY, CACHE_INVALID, CACHE_VALID, NO_DEADLINE, request, result, state
 
Constructor Summary
ResultCacheEntryRelaxed(SelectRequest request, ControllerResultSet result, long timeout, boolean keepIfNotDirty)
          Create a new Relaxed Query Cache entry
 
Method Summary
 long getDeadline()
          Get the expiration deadline
 boolean getKeepIfNotDirty()
          Should the entry must be kept in the cache if the entry is not dirty once the timeout has expired.
 long getTimeout()
          Get the timeout for this entry.
 java.lang.String getType()
          Get the type of this entry as a string
 void invalidate()
          Invalidates this cache entry (removes the ResultSet and turn state to AbstractResultCacheEntry.CACHE_INVALID).
 void setDeadline(long deadline)
          Set the expiration deadline
 java.lang.String[] toStringTable()
          Get data about this entry
 
Methods inherited from class org.objectweb.cjdbc.controller.cache.result.entries.AbstractResultCacheEntry
getNext, getPrev, getRequest, getResult, getSizeOfResult, getState, isDirty, isValid, markDirty, setNext, setPrev, setResult, setValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeout

private long timeout

deadline

private long deadline

keepIfNotDirty

private boolean keepIfNotDirty
Constructor Detail

ResultCacheEntryRelaxed

public ResultCacheEntryRelaxed(SelectRequest request,
                               ControllerResultSet result,
                               long timeout,
                               boolean keepIfNotDirty)
Create a new Relaxed Query Cache entry

Parameters:
request - Select request to cache
result - ResultSet to cache
timeout - timeout in ms for this entry
keepIfNotDirty - true if entry must be kept in cache if not dirty once timeout has expired
Method Detail

invalidate

public void invalidate()
Description copied from class: AbstractResultCacheEntry
Invalidates this cache entry (removes the ResultSet and turn state to AbstractResultCacheEntry.CACHE_INVALID).

Specified by:
invalidate in class AbstractResultCacheEntry
See Also:
AbstractResultCacheEntry.invalidate()

getType

public java.lang.String getType()
Description copied from class: AbstractResultCacheEntry
Get the type of this entry as a string

Specified by:
getType in class AbstractResultCacheEntry
Returns:
NoCache or Eager or Relaxed
See Also:
AbstractResultCacheEntry.getType()

getDeadline

public long getDeadline()
Get the expiration deadline

Returns:
the expiration deadline

setDeadline

public void setDeadline(long deadline)
Set the expiration deadline

Parameters:
deadline - time in ms relative to current time

getTimeout

public long getTimeout()
Get the timeout for this entry.

Returns:
timeout in ms

toStringTable

public java.lang.String[] toStringTable()
Description copied from class: AbstractResultCacheEntry
Get data about this entry

Specified by:
toStringTable in class AbstractResultCacheEntry
Returns:
an array [request,type,status(valid,notvalid,dirty),deadLine]
See Also:
AbstractResultCacheEntry.toStringTable()

getKeepIfNotDirty

public boolean getKeepIfNotDirty()
Should the entry must be kept in the cache if the entry is not dirty once the timeout has expired.

Returns:
true if yes


Copyright © 2002, 2005 - ObjectWeb Consortium - All Rights Reserved.