Java Doc for AbstractResultCache.java in  » Database-JDBC-Connection-Pool » sequoia-2.10.9 » org » continuent » sequoia » controller » cache » result » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database JDBC Connection Pool » sequoia 2.10.9 » org.continuent.sequoia.controller.cache.result 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.continuent.sequoia.controller.cache.result.AbstractResultCache

All known Subclasses:   org.continuent.sequoia.controller.cache.result.ResultCache,
AbstractResultCache
abstract public class AbstractResultCache implements XmlComponent(Code)
This class defines the minimal functionnalities that a request cache must provide.

Only read requests (SELECTs) can be cached, there is no sense to cache writes as they do not provide any result to cache. However, the cache must be notified of the write queries in order to maintain cache coherency.
author:
   Emmanuel Cecchet
author:
   Nicolas Modrzyk
version:
   1.0



Field Summary
protected static  Tracelogger
     Logger instance.
protected  intparsingGranularity
     Parsing granularity.


Method Summary
abstract public  voidaddCachingRule(ResultCacheRule rule)
     Add precise management and configuration of the cache behavior.
abstract public  voidaddToCache(SelectRequest request, ControllerResultSet result)
     Adds an entry request/reply to the cache.
abstract public  voidcommit(long transactionId)
     Commit a transaction given its id.
abstract public  voidflushCache()
     Removes all entries from the cache.
abstract public  String[][]getCacheData()
    
abstract public  longgetCacheSize()
    
abstract public  CacheStatisticsgetCacheStatistics()
    
abstract public  String[][]getCacheStatsData()
     Returns a bunch of stats collected by the cache, such as cache hits.
abstract public  ResultCacheRulegetDefaultRule()
     Return the default cache rule default query cache rule.
abstract public  AbstractResultCacheEntrygetFromCache(SelectRequest request, boolean addToPendingQueries)
     Gets the result to the given request from the cache.
public  intgetParsingGranularity()
     Gets the needed query parsing granularity.
public  StringgetXml()
    
abstract protected  StringgetXmlImpl()
    
abstract public  booleanisUpdateNecessary(UpdateRequest request)
     Returns true if the cache does not contain the values that are given in the update statement.
public  voidmergeDatabaseSchema(DatabaseSchema dbs)
     Merge the given DatabaseSchema with the current one.
abstract public  voidremoveFromCache(SelectRequest request)
     Removes an entry from the cache (both request and reply are dropped).
abstract public  voidremoveFromPendingQueries(SelectRequest request)
     Removes an entry from the pending query list.
abstract public  voidrollback(long transactionId)
     Rollback a transaction given its id.
public  voidsetDatabaseSchema(DatabaseSchema dbs)
     Sets the DatabaseSchema of the current virtual database.
abstract public  voidsetDefaultRule(ResultCacheRule defaultRule)
    
public  voidsetParsingGranularity(int parsingGranularity)
     Sets the needed query parsing granularity.
abstract public  voidshutdown()
     Shutdown the result cache and all its threads.
abstract public  voidwriteNotify(AbstractWriteRequest request)
     Notifies the cache that the given write request has been issued, so that cache coherency can be maintained.

Field Detail
logger
protected static Trace logger(Code)
Logger instance.



parsingGranularity
protected int parsingGranularity(Code)
Parsing granularity. Default is: org.continuent.sequoia.controller.requests.ParsingGranularities.NO_PARSING .





Method Detail
addCachingRule
abstract public void addCachingRule(ResultCacheRule rule)(Code)
Add precise management and configuration of the cache behavior. A cache rule contains information on a query pattern and how to act if that pattern was matched.
Parameters:
  rule - of action for the cache
See Also:   org.continuent.sequoia.controller.cache.result.ResultCacheRule



addToCache
abstract public void addToCache(SelectRequest request, ControllerResultSet result) throws CacheException(Code)
Adds an entry request/reply to the cache. Note that if the request was already in the cache, its result must be updated in any case but the request must never appear twice in the cache.
Parameters:
  request - the request
Parameters:
  result - the result corresponding to the request
exception:
  CacheException - if an error occurs



commit
abstract public void commit(long transactionId) throws CacheException(Code)
Commit a transaction given its id.
Parameters:
  transactionId - the transaction id
throws:
  CacheException - if an error occurs



flushCache
abstract public void flushCache()(Code)
Removes all entries from the cache.



getCacheData
abstract public String[][] getCacheData() throws CacheException(Code)
Returns the content of the cache as displayable array of array of string the data
throws:
  CacheException - if fails



getCacheSize
abstract public long getCacheSize()(Code)
Returns number of entries in the cache integer value representing the total number of entries



getCacheStatistics
abstract public CacheStatistics getCacheStatistics()(Code)
Returns pointer to the stats collector CacheStatistics object



getCacheStatsData
abstract public String[][] getCacheStatsData() throws CacheException(Code)
Returns a bunch of stats collected by the cache, such as cache hits. the data
throws:
  CacheException - if fails to collect the data.



getDefaultRule
abstract public ResultCacheRule getDefaultRule()(Code)
Return the default cache rule default query cache rule. Cannot be null



getFromCache
abstract public AbstractResultCacheEntry getFromCache(SelectRequest request, boolean addToPendingQueries)(Code)
Gets the result to the given request from the cache.

The returned AbstractResultCacheEntry is null if the request is not present in the cache.

An invalid CacheEntry may be returned (it means that the result is null) but the already parsed query can be retrieved from the cache entry.
Parameters:
  request - an SQL select request
Parameters:
  addToPendingQueries - true if the request must be added to the pendingquery list on a cache miss the AbstractResultCacheEntry if found, else null




getParsingGranularity
public int getParsingGranularity()(Code)
Gets the needed query parsing granularity. needed query parsing granularity
See Also:   AbstractResultCache.setParsingGranularity



getXml
public String getXml()(Code)

See Also:   org.continuent.sequoia.common.xml.XmlComponent.getXml



getXmlImpl
abstract protected String getXmlImpl()(Code)
Gets information about the request cache in xml xml formatted String containing information



isUpdateNecessary
abstract public boolean isUpdateNecessary(UpdateRequest request) throws CacheException(Code)
Returns true if the cache does not contain the values that are given in the update statement.
Parameters:
  request - the update request that needs to be executed false if the request shouldn't be executed, true otherwise.
exception:
  CacheException - if an error occurs



mergeDatabaseSchema
public void mergeDatabaseSchema(DatabaseSchema dbs)(Code)
Merge the given DatabaseSchema with the current one.
Parameters:
  dbs - a DatabaseSchema value
See Also:   org.continuent.sequoia.controller.cache.result.schema.CacheDatabaseSchema



removeFromCache
abstract public void removeFromCache(SelectRequest request)(Code)
Removes an entry from the cache (both request and reply are dropped). The request is NOT removed from the pending query list, but it shouldn't be in this list.
Parameters:
  request - a SelectRequest



removeFromPendingQueries
abstract public void removeFromPendingQueries(SelectRequest request)(Code)
Removes an entry from the pending query list.
Parameters:
  request - a SelectRequest



rollback
abstract public void rollback(long transactionId) throws CacheException(Code)
Rollback a transaction given its id.
Parameters:
  transactionId - the transaction id
throws:
  CacheException - if an error occurs



setDatabaseSchema
public void setDatabaseSchema(DatabaseSchema dbs)(Code)
Sets the DatabaseSchema of the current virtual database.
Parameters:
  dbs - a DatabaseSchema value
See Also:   org.continuent.sequoia.controller.cache.result.schema.CacheDatabaseSchema



setDefaultRule
abstract public void setDefaultRule(ResultCacheRule defaultRule)(Code)
Set the default query rule
Parameters:
  defaultRule - default rule to set



setParsingGranularity
public void setParsingGranularity(int parsingGranularity)(Code)
Sets the needed query parsing granularity.
Parameters:
  parsingGranularity - the query parsing granularity to set
See Also:   AbstractResultCache.getParsingGranularity



shutdown
abstract public void shutdown()(Code)
Shutdown the result cache and all its threads.



writeNotify
abstract public void writeNotify(AbstractWriteRequest request) throws CacheException(Code)
Notifies the cache that the given write request has been issued, so that cache coherency can be maintained. If the cache is distributed, this method is reponsible for broadcasting this information to other caches.
Parameters:
  request - an AbstractWriteRequest value
exception:
  CacheException - if an error occurs



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.