}
@Override
public void deleteResource() throws Exception {
DeploymentManager deploymentManager = getConnection()
.getDeploymentManager();
log.debug("Stopping deployment [" + this.deploymentUrl + "]..."); //$NON-NLS-1$ //$NON-NLS-2$
DeploymentProgress progress = deploymentManager
.stop(this.deploymentUrl);
DeploymentStatus stopStatus = DeploymentUtils.run(progress);
if (stopStatus.isFailed()) {
log.error("Failed to stop deployment '" + this.deploymentUrl //$NON-NLS-1$
+ "'.", stopStatus.getFailure()); //$NON-NLS-1$
throw new Exception("Failed to stop deployment '" //$NON-NLS-1$
+ this.deploymentName + "' - cause: " //$NON-NLS-1$
+ stopStatus.getFailure());
}
log.debug("Removing deployment [" + this.deploymentUrl + "]..."); //$NON-NLS-1$ //$NON-NLS-2$
progress = deploymentManager.remove(this.deploymentUrl);
DeploymentStatus removeStatus = DeploymentUtils.run(progress);
if (removeStatus.isFailed()) {
log.error("Failed to remove deployment '" + this.deploymentUrl //$NON-NLS-1$
+ "'.", removeStatus.getFailure()); //$NON-NLS-1$
throw new Exception("Failed to remove deployment '" //$NON-NLS-1$