Java Code Examples for com.github.jknack.handlebars.cache.ConcurrentMapTemplateCache

The following examples show how to use com.github.jknack.handlebars.cache.ConcurrentMapTemplateCache. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: arcusplatform   Author: arcus-smart-home   File: HandlebarsTemplateService.java    License: Apache License 2.0 5 votes vote down vote up
private void init(String prefix, int cacheSize){
	LOGGER.info("Handlebars Template Service Initialization with a location of {} and cache size of {}",prefix,cacheSize);
	templateCache = new ConcurrentMapTemplateCache();		
	
	TemplateLoader loader=new IrisResourceLoader(prefix, cacheSize);
	handlebars=new Handlebars(loader)
		.with(templateCache)
		.registerHelper(EnumHelper.NAME, EnumHelper.INSTANCE)
		.registerHelper(IfEqualHelper.NAME, IfEqualHelper.INSTANCE)
		.registerHelpers(HandlebarsHelpersSource.class)
		.registerHelpers(StringHelpers.class)
		.registerHelper(PluralizeHelper.NAME, PluralizeHelper.INSTANCE);
}
 
Example #2
Source Project: StubbornJava   Author: StubbornJava   File: Templating.java    License: MIT License 4 votes vote down vote up
public Builder withCaching() {
    log.debug("Using caching handlebars");
    handlebars.with(new ConcurrentMapTemplateCache());
    return this;
}
 
Example #3
Source Project: StubbornJava   Author: StubbornJava   File: Templating.java    License: MIT License 4 votes vote down vote up
public Builder withCaching() {
    log.debug("Using caching handlebars");
    handlebars.with(new ConcurrentMapTemplateCache());
    return this;
}