}
public void change(DeploymentContext context, DeploymentStage stage) throws DeploymentException
{
if (context == null)
throw new DeploymentException("Null context");
if (stage == null)
throw new DeploymentException("Null stage");
String stageName = stage.getName();
if (stages.containsKey(stage.getName()) == false)
throw new DeploymentException("Unknown deployment stage: " + stage);
DeploymentControllerContext deploymentControllerContext = context.getTransientAttachments().getAttachment(ControllerContext.class.getName(), DeploymentControllerContext.class);
if (deploymentControllerContext == null)
throw new DeploymentException("Deployment " + context.getName() + " has no deployment controller context");
checkShutdown();
context.setRequiredStage(stage);
ControllerState state = new ControllerState(stageName);