public void deploy(DeploymentFileData deploymentFileData) throws DeploymentException {
log.debug("Started to deploy the deployment artefact: "+deploymentFileData.getFile());
serviceContextLookUpStructure = FasterLookUpDataHolder.getInstance();
AxiomXpathParser parser = new AxiomXpathParser(deploymentFileData.getFile());
parser.parse();
// validate
try {
validateService(parser);
} catch (Exception e) {
String msg = "Invalid deployment artefact at "+deploymentFileData.getAbsolutePath();
// back up the file
File f = deploymentFileData.getFile();
f.renameTo(new File(deploymentFileData.getAbsolutePath()+".back"));
log.error(msg, e);
throw new DeploymentException(msg, e);
}
// deploy
List<ServiceContext> services = parser.getServiceContexts();
// notify consumer by adding the diff
try {
serviceContextLookUpStructure.getSharedTopologyDiffQueue().put(services);
} catch (InterruptedException ignore) {