C P
unread,Oct 24, 2016, 9:16:41 AM10/24/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to handlebars.java
while using template.apply() , where we have to pass Context as a first parameter.
We are creating this Context using a model which is a java.util.Hashmap.
Now this hashmap resource gets locked while creating the context.
Wanted to know is there a recommendation for using concurrenthashmap and not using the java.util.hashmap as a model, because this hashmap is getting locked and causing the subsequent threads wait for this resource.
Here is the code: here model is the java.util.Hashmap
hbContext = Context.newBuilder(model).resolver(FieldValueResolver.INSTANCE, MapValueResolver.INSTANCE,JavaBeanValueResolver.INSTANCE,MethodValueResolver.INSTANCE).build();
template.apply(hbContext, scriptContext.getWriter());
Thanks.