String newEnvironmentName = getNewEnvironmentName(this.environmentName);
if (getLog().isInfoEnabled())
getLog().info("And it'll be named " + newEnvironmentName);
CreateEnvironmentResult createEnvResult = createEnvironment(
cnamePrefixToCreate, newEnvironmentName);
/*
* Waits for completion
*/
EnvironmentDescription newEnvDesc = null;
try {
newEnvDesc = waitForEnvironment(createEnvResult.getEnvironmentId());
} catch (Exception exc) {
/*
* Terminates the failed launched environment
*/
terminateAndWaitForEnvironment(createEnvResult.getEnvironmentId());
handleException(exc);
return null;
}