|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CacheRetriever
Interface for retrieving objects to be stored in a Cache
.
This interface may be implemented in order to retrieve templates from
a different data store, such as a relational database.
Method Summary | |
---|---|
boolean |
connectionOk()
Corresponds to checkCacheDir for file-system implementations. |
boolean |
exists(java.lang.String location)
Tests whether the object still exists in the template repository. |
java.lang.String |
getConnection()
Gets the connection for this retriever. |
java.util.List<java.lang.String> |
getPreloadData()
Returns a list of objects ( String s) to pre-load the cache with. |
long |
lastModified(java.lang.String location)
Determines when the object in the template repository was last modified. |
Cacheable |
loadData(java.lang.String location,
java.lang.String type,
Cache cache)
Retrieves data of the appropriate type to be stored in the cache. |
Method Detail |
---|
Cacheable loadData(java.lang.String location, java.lang.String type, Cache cache) throws TemplateException
location
- the location of the data to be retrievedtype
- the type of object to be returnedcache
- the cache to which the item will be added
Cacheable
object loaded from the data source
TemplateException
- the object could not be loadedboolean exists(java.lang.String location)
location
- the location of the object to be tested
true
if the object still exists in the repository,
otherwise false
lastModified(java.lang.String)
long lastModified(java.lang.String location) throws TemplateException
Determines when the object in the template repository was last modified.
location
- the location of the object to be tested
TemplateException
- is thrown whenever the item:
java.util.List<java.lang.String> getPreloadData() throws TemplateException
String
s) to pre-load the cache with.
List
of String
s to preload the
cache with
TemplateException
boolean connectionOk() throws TemplateException
true
if the connection is ok, otherwise false
TemplateException
- whenever the connection has failed, and cannot
be re-establishedjava.lang.String getConnection()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |