Class HighConcurrencyTemplateCache
- java.lang.Object
-
- com.github.jknack.handlebars.cache.HighConcurrencyTemplateCache
-
- All Implemented Interfaces:
TemplateCache
public class HighConcurrencyTemplateCache extends java.lang.Object implements TemplateCache
A high concurrency template cache.- Since:
- 0.11.0
-
-
Constructor Summary
Constructors Constructor Description HighConcurrencyTemplateCache()
Creates a new HighConcurrencyTemplateCache.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
Remove all mappings from the cache.void
evict(TemplateSource source)
Evict the mapping for this source from this cache if it is present.Template
get(TemplateSource source, Parser parser)
Return the value to which this cache maps the specified key.HighConcurrencyTemplateCache
setReload(boolean reload)
Turn on/off auto reloading of templates.
-
-
-
Method Detail
-
clear
public void clear()
Description copied from interface:TemplateCache
Remove all mappings from the cache.- Specified by:
clear
in interfaceTemplateCache
-
evict
public void evict(TemplateSource source)
Description copied from interface:TemplateCache
Evict the mapping for this source from this cache if it is present.- Specified by:
evict
in interfaceTemplateCache
- Parameters:
source
- the source whose mapping is to be removed from the cache
-
get
public Template get(TemplateSource source, Parser parser) throws java.io.IOException
Description copied from interface:TemplateCache
Return the value to which this cache maps the specified key.- Specified by:
get
in interfaceTemplateCache
- Parameters:
source
- source whose associated template is to be returned.parser
- The Handlebars parser.- Returns:
- A template.
- Throws:
java.io.IOException
- If input can't be parsed.
-
setReload
public HighConcurrencyTemplateCache setReload(boolean reload)
Description copied from interface:TemplateCache
Turn on/off auto reloading of templates. Auto reload is done usingTemplateSource.lastModified()
.- Specified by:
setReload
in interfaceTemplateCache
- Parameters:
reload
- True, for turning off template reload. Default is: false.- Returns:
- This template loader.
-
-