Phase specific execution logic will go in this method. Any phase implementing
this class will provide its implementation for this method.
String type = null;
DeploymentRequest req = phaseCtx.getDeploymentRequest();
DeploymentStatus status = phaseCtx.getDeploymentStatus();
DeploymentTarget target = (DeploymentTarget)req.getTarget();
if(target == null) {
String msg = localStrings.getString("enterprise.deployment.phasing.start.targetnotspecified");
sLogger.log(Level.FINEST, msg);
status.setStageStatus(DeploymentStatus.SUCCESS);
return;
}
if (!DeploymentServiceUtils.containsResourceAdapter(req)) {
status.setStageStatus(DeploymentStatus.SUCCESS);
return;
}
if (!req.isApplication()) {
type = DeploymentServiceUtils.getModuleTypeString(req.getType());
}
prePhaseNotify(getPrePhaseEvent(req));
int actionCode = req.getActionCode();
boolean success;
try {
// send this event to load standalone rar
// or the rar part of the embedded rar
success = target.sendStartEvent(actionCode, req.getName(), type,
req.isForced(), Constants.LOAD_RAR);
} catch(DeploymentTargetException dte) {
status.setStageStatus(DeploymentStatus.WARNING);
if (dte.getCause()!=null) {
status.setStageStatusMessage(dte.getMessage());
}
return;
}
if (success) {
status.setStageStatus(DeploymentStatus.SUCCESS);
} else {
status.setStageStatus(DeploymentStatus.WARNING);
status.setStageStatusMessage("Application failed to load");
}
postPhaseNotify(getPostPhaseEvent(req));
// if any exception arrise, we let it unroll this stack, it will
// be processed by DeploymentService