|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--freemarker.template.cache.BaseCachingStrategy | +--freemarker.template.cache.NullCachingStrategy
Implements the most simple caching strategy possible: a null cache. That is, no caching takes place at all, the strategy simply forwards all requests onto the cache retriever.
Fields inherited from class freemarker.template.cache.BaseCachingStrategy |
eventHandler, retriever |
Constructor Summary | |
NullCachingStrategy()
Creates new NullCachingStrategy. |
|
NullCachingStrategy(CacheRetriever retriever)
Creates new NullCachingStrategy with a cache retriever. |
Method Summary | |
void |
clearCache()
Clears all the elements in the cache. |
long |
getDelay()
Returns the interval between two cache updates. |
Cacheable |
getItem(java.lang.String name)
Retrieves an item from the cache, according to the loading policy implemented. |
Cacheable |
getItem(java.lang.String name,
java.lang.String type)
Retrieves an item from the cache, according to the loading policy implemented. |
int |
getMaximumAge()
Retrieves the maximum age a cache item can be before it is evicted from the cache. |
java.util.Iterator |
listCachedFiles()
Retrieves a list of objects currently in the cache. |
void |
setDefaultTemplate(java.lang.String template)
Sets the default template to use when retrieving. |
void |
setDelay(long delay)
Sets the interval between two cache updates. |
void |
setMaximumAge(int age)
Sets the maximum age a cache item can be before it is evicted from the cache. |
void |
startAutoUpdate()
Begins automatic updates of the cache. |
void |
stopAutoUpdate()
Stops automatically updating the cache. |
java.lang.String |
toString()
Returns a string representation of the object. |
void |
update()
Asks for a "blank" update. |
void |
update(java.lang.String name)
Asks for the named object to be updated. |
void |
update(java.lang.String name,
java.lang.String type)
Asks for the named object to be updated. |
Methods inherited from class freemarker.template.cache.BaseCachingStrategy |
addCacheListener, connectionOk, getCacheListeners, getCacheRetriever, removeCacheListener, setCacheRetriever, setEventHandler |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public NullCachingStrategy()
public NullCachingStrategy(CacheRetriever retriever)
retriever
- the retriever to use to pull items from the data storeMethod Detail |
public void setDelay(long delay)
delay
- the number of seconds between cache updatespublic long getDelay()
public void setMaximumAge(int age)
age
- the maximum age before an item is evicted from the cachepublic int getMaximumAge()
public Cacheable getItem(java.lang.String name)
name
- the name of the item to retrieveCacheable
object, or null
if not found or an error has occurredpublic Cacheable getItem(java.lang.String name, java.lang.String type)
name
- the name of the item to retrievetype
- the type of the item to retrieveCacheable
object, or null
if not found or an error has occurredpublic java.util.Iterator listCachedFiles()
null
, indicating that no caching is usedpublic void update()
freemarker.template.cache.Updateable
java.lang.InterruptedException
- The current thread was interrupted during
the update. Callers should either throw the exception back up the
call stack, or set the interrupted status by using the
Thread.currentThread().interrupt()
method.public void update(java.lang.String name)
name
- the name of the object to updatepublic void update(java.lang.String name, java.lang.String type)
name
- the name of the object to updatetype
- the type of the object to updatepublic void startAutoUpdate()
public void stopAutoUpdate()
public void clearCache()
public void setDefaultTemplate(java.lang.String template)
template
- the type of template to be used by default when retrieving
objects from the repositorypublic java.lang.String toString()
toString
in class java.lang.Object
String
representation of the object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |