Class Database.QueryCacheExecutor
- java.lang.Object
-
- org.apache.manifoldcf.core.cachemanager.ExecutorBase
-
- org.apache.manifoldcf.core.database.Database.QueryCacheExecutor
-
- All Implemented Interfaces:
ICacheExecutor
- Enclosing class:
- Database
public static class Database.QueryCacheExecutor extends ExecutorBase
This object is meant to execute within a cache manager call. It contains all knowledge needed to perform any query, including a parameterized one. It may (or may not) be also passed a transaction handle, depending on whether or not a transaction is currently underway. Nevertheless, all database access, save transaction setup and teardown, takes place inside this class. Even uncached queries will be done here; the cache manager will simply not keep the result around afterwards.
-
-
Field Summary
Fields Modifier and Type Field Description protected Databasedatabaseprotected booleanneedResultprotected IResultSetresultset-
Fields inherited from class org.apache.manifoldcf.core.cachemanager.ExecutorBase
_rcsid
-
-
Constructor Summary
Constructors Constructor Description QueryCacheExecutor(Database database, boolean needResult)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object[]create(ICacheDescription[] objectDescriptions)Create a new object to operate on and cache.voidexecute()Perform the desired operation.voidexists(ICacheDescription objectDescription, java.lang.Object cachedObject)Notify the implementing class of the existence of a cached version of the object.IResultSetgetResult()Fetch the result.
-
-
-
Field Detail
-
database
protected Database database
-
needResult
protected boolean needResult
-
resultset
protected IResultSet resultset
-
-
Constructor Detail
-
QueryCacheExecutor
public QueryCacheExecutor(Database database, boolean needResult)
-
-
Method Detail
-
getResult
public IResultSet getResult()
Fetch the result. No errors are possible at this time; they would have already occurred...
-
create
public java.lang.Object[] create(ICacheDescription[] objectDescriptions) throws ManifoldCFException
Create a new object to operate on and cache. This method is called only if the specified object is NOT available in the cache. The specified object should be created and returned; if it is not created, it means that the execution cannot proceed, and the execute() method will not be called.- Parameters:
objectDescriptions- are the unique identifiers of the objects.- Returns:
- the newly created objects to cache, or null, if any object cannot be created.
- Throws:
ManifoldCFException
-
exists
public void exists(ICacheDescription objectDescription, java.lang.Object cachedObject) throws ManifoldCFException
Notify the implementing class of the existence of a cached version of the object. The object is passed to this method so that the execute() method below will have it available to operate on. This method is also called for all objects that are freshly created as well.- Parameters:
objectDescription- is the unique identifier of the object.cachedObject- is the cached object.- Throws:
ManifoldCFException
-
execute
public void execute() throws ManifoldCFExceptionPerform the desired operation. This method is called after either createGetObject() or exists() is called for every requested object.- Throws:
ManifoldCFException
-
-