if (log.isDebugEnabled()) {
log.debug("Endpoint Update from file : " + fileName + " : Started");
}
try {
Endpoint ep = EndpointFactory.getEndpointFromElement(artifactConfig, false, properties);
if (ep != null) {
ep.setFileName((new File(fileName)).getName());
if (log.isDebugEnabled()) {
log.debug("Endpoint named '" + ep.getName()
+ "' has been built from the file " + fileName);
}
ep.init(getSynapseEnvironment());
if (log.isDebugEnabled()) {
log.debug("Initialized the endpoint : " + ep.getName());
}
Endpoint existingEp
= getSynapseConfiguration().getDefinedEndpoints().get(existingArtifactName);
getSynapseConfiguration().removeEndpoint(existingArtifactName);
if (!existingArtifactName.equals(ep.getName())) {
log.info("Endpoint named " + existingArtifactName + " has been Undeployed");
}
getSynapseConfiguration().addEndpoint(ep.getName(), ep);
existingEp.destroy();
if (log.isDebugEnabled()) {
log.debug("Endpoint " + (existingArtifactName.equals(ep.getName()) ?
"update" : "deployment") + " from file : " + fileName + " : Completed");
}
log.info("Endpoint named '" + ep.getName()