{
//Download necessary responder file
activeProcessDao.acquireLock();
try
{
FileInfo fileInfo = process.getResponder().getFileInfo();
File warFile = new File(webappDir, fileInfo.getName());
if (warFile.exists())
{
logger.log(Level.INFO,
"WAR file: {0} already exists. It''s not necessary to "
+ "download/install responder: {1}",
new Object[]{warFile.getAbsolutePath(),
process.getResponder().getTaskTypeGuid()});
}
else
{
process.setState(ActiveProcess.State.DOWNLOADING);
activeProcessDao.updateProcess(process);
logger.log(Level.INFO,
"Downloading responder executable: {0} to {1}",
new Object[]{fileInfo.toString(), warFile.getAbsolutePath()});
runtime.getMicrobaseFS().download(
fileInfo.getBucket(), fileInfo.getPath(), fileInfo.getName(),
warFile);
logger.log(Level.INFO, "Download of: {0} complete", fileInfo.toString());
process.setState(ActiveProcess.State.INSTALLING);
activeProcessDao.updateProcess(process);
try
{
Thread.sleep(WAIT_FOR_CONTAINER_DEPLOY_MS);