if (log.isDebugEnabled()) {
log.debug("PriorityExecutor update from file : " + fileName + " has started");
}
try {
PriorityExecutor e = PriorityExecutorFactory.createExecutor(
SynapseConstants.SYNAPSE_NAMESPACE, artifactConfig, true, properties);
if (e == null) {
handleSynapseArtifactDeploymentError("PriorityExecutor update failed. The artifact " +
"defined in the file: " + fileName + " is not a valid executor.");
return null;
}
e.setFileName(new File(fileName).getName());
if (log.isDebugEnabled()) {
log.debug("Executor: " + e.getName() + " has been built from the file: " + fileName);
}
e.init();
PriorityExecutor existingExecutor = getSynapseConfiguration().getPriorityExecutors().
get(existingArtifactName);
if (existingArtifactName.equals(e.getName())) {
getSynapseConfiguration().updatePriorityExecutor(existingArtifactName, e);
} else {
// The user has changed the name of the executor
// We should add the updated executor as a new executor and remove the old one
getSynapseConfiguration().addPriorityExecutor(e.getName(), e);
getSynapseConfiguration().removeExecutor(existingArtifactName);
log.info("Executor: " + existingArtifactName + " has been undeployed");
}
waitForCompletion();
existingExecutor.destroy();
log.info("PriorityExecutor: " + e.getName() + " has been updated from the file: " + fileName);
return e.getName();
} catch (DeploymentException e) {