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;
}
prePhaseNotify(getPrePhaseEvent(req));
int actionCode = req.getActionCode();
int loadUnloadAction = Constants.LOAD_ALL;
if(req.isApplication()) {
type = null;
Application app = DeploymentServiceUtils.getInstanceManager(
DeployableObjectType.APP).getRegisteredDescriptor(req.getName());
if ( (app != null) && (app.getRarComponentCount() != 0) ) {
loadUnloadAction = Constants.LOAD_REST;
}
}
else {
type = DeploymentServiceUtils.getModuleTypeString(req.getType());
}
boolean success;
try {
// send this event to load non-rar standalone module or application
// or to load the non-rar submodules of embedded rar
if (! req.isConnectorModule()) {
success = target.sendStartEvent(actionCode, req.getName(), type,
req.isForced(), loadUnloadAction);
} else {
status.setStageStatus(DeploymentStatus.SUCCESS);
return;
}
} 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