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