protected final Status executeDeployment(final ModelControllerClient client, final Deployment deployment) throws DeploymentExecutionException, DeploymentFailureException, IOException {
// Execute before deployment commands
if (beforeDeployment != null) beforeDeployment.execute(client);
// Deploy the deployment
getLog().debug("Executing deployment");
final Status status = deployment.execute();
// Execute after deployment commands
if (afterDeployment != null) afterDeployment.execute(client);
return status;
}