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

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

Inheritance diagram for org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ResultCacheEntryRelaxed (SelectRequest request, ControllerResultSet result, long timeout, boolean keepIfNotDirty)
void invalidate ()
String getType ()
long getDeadline ()
void setDeadline (long deadline)
long getTimeout ()
String[] toStringTable ()
boolean getKeepIfNotDirty ()

Detailed Description

A CacheEntry that is to be recognized as Relaxed entry.

Author:
Nicolas Modrzyk

Emmanuel Cecchet

Version:
1.0

Definition at line 39 of file ResultCacheEntryRelaxed.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed.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

Definition at line 54 of file ResultCacheEntryRelaxed.java.

00056   {
00057     super(request, result);
00058     this.timeout = timeout;
00059     this.deadline = System.currentTimeMillis() + timeout;
00060     this.keepIfNotDirty = keepIfNotDirty;
00061   }


Member Function Documentation

long org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed.getDeadline  ) 
 

Get the expiration deadline

Returns:
the expiration deadline

Definition at line 84 of file ResultCacheEntryRelaxed.java.

Referenced by org.objectweb.cjdbc.controller.cache.result.ResultCache.addToCache(), org.objectweb.cjdbc.controller.cache.result.threads.RelaxedCacheThread.run(), and org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed.toStringTable().

00085   {
00086     return deadline;
00087   }

boolean org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed.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

Definition at line 124 of file ResultCacheEntryRelaxed.java.

Referenced by org.objectweb.cjdbc.controller.cache.result.threads.RelaxedCacheThread.run().

00125   {
00126     return keepIfNotDirty;
00127   }

long org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed.getTimeout  ) 
 

Get the timeout for this entry.

Returns:
timeout in ms

Definition at line 104 of file ResultCacheEntryRelaxed.java.

Referenced by org.objectweb.cjdbc.controller.cache.result.threads.RelaxedCacheThread.run().

00105   {
00106     return timeout;
00107   }

String org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed.getType  )  [virtual]
 

See also:
org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntry.getType()

Implements org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntry.

Definition at line 74 of file ResultCacheEntryRelaxed.java.

Referenced by org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed.toStringTable().

00075   {
00076     return "Relaxed";
00077   }

void org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed.invalidate  )  [virtual]
 

See also:
org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntry.invalidate()

Implements org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntry.

Definition at line 66 of file ResultCacheEntryRelaxed.java.

00067   {
00068     state = CACHE_DIRTY;
00069   }

void org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed.setDeadline long  deadline  ) 
 

Set the expiration deadline

Parameters:
deadline time in ms relative to current time

Definition at line 94 of file ResultCacheEntryRelaxed.java.

Referenced by org.objectweb.cjdbc.controller.cache.result.threads.RelaxedCacheThread.run().

00095   {
00096     this.deadline = deadline;
00097   }

String [] org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed.toStringTable  )  [virtual]
 

See also:
org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntry.toStringTable()

Implements org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntry.

Definition at line 112 of file ResultCacheEntryRelaxed.java.

References org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed.getDeadline(), org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntry.getSizeOfResult(), org.objectweb.cjdbc.common.sql.AbstractRequest.getSQL(), org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntry.getState(), and org.objectweb.cjdbc.controller.cache.result.entries.ResultCacheEntryRelaxed.getType().

00113   {
00114     return new String[]{request.getSQL(), getType(), getState(),
00115         new Date(getDeadline()).toString(), "" + getSizeOfResult()};
00116   }


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