try {
lock.lock();
TemplateMediator template;
template = (TemplateMediator) getSynapseConfiguration().getSequenceTemplate(templateName);
if (template != null) {
template.enableStatistics();
persistTemplate(template);
return templateName;
} else {
handleException("No defined template with name " + templateName
+ " found to enable statistics in the Synapse configuration");