// FileUtil.moveFile(artifactFile, targetDir);
FileUtil.unpackArchive(artifactFile, targetDir);
// now get the component and give it a SA
}
else {
throw new DeploymentException("artifact: " + artifact + "(" + artifactFile.getAbsolutePath()
+ ") doesn't exist");
}
}
Component component = container.getComponent(componentName);
if (component != null) {
ServiceUnitManager sum = component.getServiceUnitManager();
if (sum != null) {
result = sum.deploy(name, targetDir.getAbsolutePath());
sum.init(name, targetDir.getAbsolutePath());
// register active endpoints
}
else {
FileUtil.deleteFile(targetDir);
throw new DeploymentException("Component " + componentName + " doesn't have a ServiceUnitManager");
}
}
else {
FileUtil.deleteFile(targetDir);
throw new DeploymentException("Component " + componentName + " doesn't exist");
}
}
catch (IOException e) {
log.error("Could not deploy ServiceUnit: " + name + " to component " + componentName, e);
throw new DeploymentException(e);
}
log.info("Deployed ServiceUnit " + name + " to Component: " + componentName);
return result;
}