Main Page | Packages | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

org.objectweb.cjdbc.controller.cache.result.rules.RelaxedCaching Class Reference

Inheritance diagram for org.objectweb.cjdbc.controller.cache.result.rules.RelaxedCaching:

Inheritance graph
[legend]
Collaboration diagram for org.objectweb.cjdbc.controller.cache.result.rules.RelaxedCaching:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RelaxedCaching (boolean keepIfNotDirty, long timeout)
CacheEntry getCacheEntry (SelectRequest sqlQuery, ControllerResultSet result, AbstractResultCache cache)
String getXml ()

Detailed Description

RelaxedCaching means we set a timeout value for this entry, and when expired we keep in the cache if no write has modified the corresponding result, we wait for the same amount of time again. RelaxedCaching may provide stale data. The timeout defines the maximum staleness of a cache entry. It means that the cache may return an entry that is out of date. timeout: is a value in seconds and 0 means no timeout (always in the cache) keepIfNotDirty: if true the entry is kept in the cache and the timeout is reset, if false, the entry is removed from the cache after the timeout has expired even if the entry was not affected by a write.

Author:
Nicolas Modrzyk

Emmanuel Cecchet

Version:
1.0

Definition at line 50 of file RelaxedCaching.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.controller.cache.result.rules.RelaxedCaching.RelaxedCaching boolean  keepIfNotDirty,
long  timeout
 

Create new RelaxedCaching action

Parameters:
timeout before we check the validity of an entry
keepIfNotDirty true if non-dirty entries must be kept in the cache

Definition at line 61 of file RelaxedCaching.java.

00062   {
00063     this.keepIfNotDirty = keepIfNotDirty;
00064     this.timeout = timeout;
00065   }


Member Function Documentation

CacheEntry org.objectweb.cjdbc.controller.cache.result.rules.RelaxedCaching.getCacheEntry SelectRequest  sqlQuery,
ControllerResultSet  result,
AbstractResultCache  cache
[virtual]
 

See also:
org.objectweb.cjdbc.controller.cache.result.CacheBehavior.getCacheEntry(SelectRequest, ControllerResultSet, AbstractResultCache)

Implements org.objectweb.cjdbc.controller.cache.result.CacheBehavior.

Definition at line 71 of file RelaxedCaching.java.

00073   {
00074     return new ResultCacheEntryRelaxed(sqlQuery, result, timeout,
00075         keepIfNotDirty);
00076   }

String org.objectweb.cjdbc.controller.cache.result.rules.RelaxedCaching.getXml  )  [virtual]
 

See also:
org.objectweb.cjdbc.common.xml.XmlComponent.getXml()

Implements org.objectweb.cjdbc.controller.cache.result.CacheBehavior.

Definition at line 81 of file RelaxedCaching.java.

00082   {
00083     return "<" + DatabasesXmlTags.ELT_RelaxedCaching + " "
00084         + DatabasesXmlTags.ATT_timeout + "=\"" + timeout / 1000 + "\" "
00085         + DatabasesXmlTags.ATT_keepIfNotDirty + "=\"" + keepIfNotDirty + "\"/>";
00086   }


The documentation for this class was generated from the following file:
Generated on Mon Apr 11 22:03:37 2005 for C-JDBC by  doxygen 1.3.9.1