|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.template.cache.BaseCachingStrategy freemarker.template.cache.LoadOnDemandCachingStrategy
public final class LoadOnDemandCachingStrategy
Implements a load-on-demand caching strategy.
Field Summary |
---|
Fields inherited from class freemarker.template.cache.BaseCachingStrategy |
---|
eventHandler, retriever |
Constructor Summary | |
---|---|
LoadOnDemandCachingStrategy()
Creates new LoadOnDemandCachingStrategy. |
|
LoadOnDemandCachingStrategy(StrategyParameters params)
Creates new LoadOnDemandCachingStrategy with the given parameters. |
Method Summary | |
---|---|
void |
clearCache()
Clears all the elements in the cache. |
java.lang.String |
getDefaultTemplateType()
Retrieves the default template type to be created when retrieving items from 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<CacheElement> |
listCachedFiles()
Retrieves a list of objects currently in 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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LoadOnDemandCachingStrategy()
public LoadOnDemandCachingStrategy(StrategyParameters params)
params
- the parameters with which to initialize this strategyMethod Detail |
---|
public long getDelay()
public int getMaximumAge()
public java.lang.String getDefaultTemplateType()
public Cacheable getItem(java.lang.String name)
name
- the name of the item to retrieve
Cacheable
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 item to be retrieved
Cacheable
object, or null
if not found or an error has occurredpublic java.util.Iterator<CacheElement> listCachedFiles()
null
if there are no items in the cache, or the strategy
does not implement a cache.public void update() throws java.lang.InterruptedException
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 stopAutoUpdate()
public void startAutoUpdate()
public void clearCache()
public java.lang.String toString()
toString
in class java.lang.Object
String
representation of the object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |