|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.template.cache.StrategyParameters
public final class StrategyParameters
Parameter class for creating new CachingStrategy objects. This is a convenience class for passing parameters to a caching strategy to configure the cache. Any additional parameters can be added to this parameter class without having to alter the method signature of the cache itself.
This is an immutable class. Calls to any of the withXXX()
methods return a new object.
Method Summary | |
---|---|
protected java.lang.Object |
clone()
Clone this object. |
java.lang.String |
getDefaultTemplateType()
Get the default template type for this strategy parameter object. |
long |
getDelay()
Get the delay for this strategy parameter object. |
CacheEventAdapter |
getEventHandler()
Get the cache event adapter for this strategy parameter object. |
int |
getMaximumAge()
Get the maximum age for this strategy parameter object. |
CacheRetriever |
getRetriever()
Get the cache retriever for this strategy parameter object. |
static StrategyParameters |
newInstance()
Create a new instances of the StrategyParameters class. |
static StrategyParameters |
newInstance(CacheRetriever retriever)
Create a new instances of the StrategyParameters class with the given cache retriever. |
static StrategyParameters |
newInstance(CacheRetriever retriever,
long delay)
Create a new instances of the StrategyParameters class with the given cache retriever and delay between cache refreshes. |
StrategyParameters |
withCacheRetriever(CacheRetriever retriever)
Return a new StrategyParameters object with the given cache retriever in place of the existing cache retriever. |
StrategyParameters |
withDefaultTemplateType(java.lang.String defaultTemplateType)
Return a new StrategyParameters object with the given default template type in place of the existing default template type. |
StrategyParameters |
withDelay(long delay)
Return a new StrategyParameters object with the given delay in place of the existing delay. |
StrategyParameters |
withEventHandler(CacheEventAdapter eventHandler)
Return a new StrategyParameters object with the given event handler in place of the existing event handler. |
StrategyParameters |
withMaximumAge(int maximumAge)
Return a new StrategyParameters object with the given maximum age in place of the existing maximum age. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static StrategyParameters newInstance()
public static StrategyParameters newInstance(CacheRetriever retriever)
retriever
- the cache retriever for this strategy parameter object
public static StrategyParameters newInstance(CacheRetriever retriever, long delay)
retriever
- the cache retriever for this strategy parameter objectdelay
- the time in seconds between cache refreshes
public StrategyParameters withCacheRetriever(CacheRetriever retriever)
retriever
- the cache retriever to use in place of the existing
cache retriever
public StrategyParameters withEventHandler(CacheEventAdapter eventHandler)
eventHandler
- the event handler to use in place of the existing
event handler
public StrategyParameters withDefaultTemplateType(java.lang.String defaultTemplateType)
defaultTemplateType
- the default template type to use in place of
the existing default template type
public StrategyParameters withDelay(long delay)
delay
- the delay in seconds to use in place of the existing delay
public StrategyParameters withMaximumAge(int maximumAge)
maximumAge
- the maximum age in multiples of delay
seconds to use in place of the existing maximum age
public CacheRetriever getRetriever()
public CacheEventAdapter getEventHandler()
public java.lang.String getDefaultTemplateType()
public long getDelay()
public int getMaximumAge()
delay
secondsprotected java.lang.Object clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |