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

org.objectweb.cjdbc.controller.cache.result.ResultCacheTable Class Reference

Inheritance diagram for org.objectweb.cjdbc.controller.cache.result.ResultCacheTable:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ResultCacheTable (int maxEntries, int pendingTimeout)
boolean isUpdateNecessary (UpdateRequest request)
String getName ()

Protected Member Functions

void processAddToCache (CacheEntry qe)
void processWriteNotify (AbstractWriteRequest request)

Detailed Description

This is a query cache implementation with a table granularity:

Author:
Emmanuel Cecchet

Nicolas Modrzyk

Version:
1.0

Definition at line 47 of file ResultCacheTable.java.


Constructor & Destructor Documentation

org.objectweb.cjdbc.controller.cache.result.ResultCacheTable.ResultCacheTable int  maxEntries,
int  pendingTimeout
 

Builds a new ResultCache with a table granularity.

Parameters:
maxEntries maximum number of entries
pendingTimeout pending timeout for concurrent queries

Definition at line 55 of file ResultCacheTable.java.

00056   {
00057     super(maxEntries, pendingTimeout);
00058     parsingGranularity = ParsingGranularities.TABLE;
00059   }


Member Function Documentation

String org.objectweb.cjdbc.controller.cache.result.ResultCacheTable.getName  )  [virtual]
 

See also:
org.objectweb.cjdbc.controller.cache.result.ResultCache.getName()

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

Definition at line 99 of file ResultCacheTable.java.

00100   {
00101     return "table";
00102   }

boolean org.objectweb.cjdbc.controller.cache.result.ResultCacheTable.isUpdateNecessary UpdateRequest  request  )  [virtual]
 

See also:
org.objectweb.cjdbc.controller.cache.result.AbstractResultCache.isUpdateNecessary(org.objectweb.cjdbc.common.sql.UpdateRequest)

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

Definition at line 74 of file ResultCacheTable.java.

00075   {
00076     return true;
00077   }

void org.objectweb.cjdbc.controller.cache.result.ResultCacheTable.processAddToCache CacheEntry  qe  )  [protected, virtual]
 

See also:
org.objectweb.cjdbc.controller.cache.result.ResultCache.processAddToCache

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

Definition at line 64 of file ResultCacheTable.java.

References org.objectweb.cjdbc.controller.cache.result.schema.CacheDatabaseTable.addCacheEntry(), org.objectweb.cjdbc.common.sql.SelectRequest.getFrom(), org.objectweb.cjdbc.controller.cache.result.entries.CacheEntry.getRequest(), and org.objectweb.cjdbc.controller.cache.result.schema.CacheDatabaseSchema.getTable().

00065   {
00066     SelectRequest request = qe.getRequest();
00067     for (Iterator i = request.getFrom().iterator(); i.hasNext();)
00068       cdbs.getTable((String) i.next()).addCacheEntry(qe);
00069   }

void org.objectweb.cjdbc.controller.cache.result.ResultCacheTable.processWriteNotify AbstractWriteRequest  request  )  [protected, virtual]
 

See also:
org.objectweb.cjdbc.controller.cache.result.ResultCache.processWriteNotify(org.objectweb.cjdbc.common.sql.AbstractWriteRequest)

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

Definition at line 82 of file ResultCacheTable.java.

References org.objectweb.cjdbc.controller.cache.result.ResultCache.flushCache(), org.objectweb.cjdbc.controller.cache.result.schema.CacheDatabaseSchema.getTable(), org.objectweb.cjdbc.common.sql.AbstractWriteRequest.getTableName(), org.objectweb.cjdbc.controller.cache.result.schema.CacheDatabaseTable.invalidateAll(), and org.objectweb.cjdbc.common.log.Trace.warn().

00083   {
00084     CacheDatabaseTable cdt = cdbs.getTable(request.getTableName());
00085 
00086     if (cdt != null)
00087       cdt.invalidateAll();
00088     else
00089     {
00090       logger.warn("Table " + request.getTableName()
00091           + " not found in cache schema. Flushing whole cache.");
00092       flushCache();
00093     }
00094   }


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