new QName(SynapseConstants.SYNAPSE_NAMESPACE, "sequence"));
if (element != null) {
Mediator mediator = MediatorFactoryFinder.getInstance().
getMediator(artifactConfig, properties);
if (mediator instanceof TemplateMediator) {
TemplateMediator tm = (TemplateMediator) mediator;
tm.setFileName((new File(fileName)).getName());
if (log.isDebugEnabled()) {
log.debug("Sequence Template named '" + tm.getName()
+ "' has been built from the file " + fileName);
}
tm.init(getSynapseEnvironment());
if (log.isDebugEnabled()) {
log.debug("Initialized the Template : " + tm.getName());
}
TemplateMediator existingSt = getSynapseConfiguration().
getSequenceTemplate(existingArtifactName);
if (existingArtifactName.equals(tm.getName())) {
getSynapseConfiguration().updateSequenceTemplate(tm.getName(), existingSt);
} else {
getSynapseConfiguration().addSequenceTemplate(tm.getName(), tm);
getSynapseConfiguration().removeSequenceTemplate(existingSt.getName());
log.info("Template: " + existingArtifactName + " has been undeployed");
}
existingSt.destroy();
log.info("Template: " + tm.getName() + " has been updated from the file: " + fileName);
return tm.getName();
}
}
}