private boolean isKeepState(DeploymentContext deployContext, boolean isDeploy) { Boolean keepState = null; if (isDeploy) { DeployCommandParameters dcp = deployContext.getCommandParameters(DeployCommandParameters.class); if (dcp != null) { keepState = dcp.keepstate; } } else { UndeployCommandParameters ucp = deployContext.getCommandParameters(UndeployCommandParameters.class); if (ucp != null) { keepState = ucp.keepstate; } } if (keepState == null) { String keepSessionsString = deployContext.getAppProps().getProperty(DeploymentProperties.KEEP_SESSIONS); if (keepSessionsString != null && keepSessionsString.trim().length() > 0) { keepState = Boolean.valueOf(keepSessionsString); } else { keepState = getDescriptor().getApplication().getKeepState(); } } return ((keepState != null) ? keepState : false); }
keepState = app.getKeepState();
keepState = app.getKeepState();
private void validateKeepStateOption(DeploymentContext context, DeployCommandParameters params, Application app) { if ((params.keepstate != null && params.keepstate) || app.getKeepState()) { if (!isDASTarget(context, params)) { // for non-DAS target, and keepstate is set to true either // through deployment option or deployment descriptor // explicitly set the deployment option to false params.keepstate = false; String warningMsg = localStrings.getLocalString("not.support.keepstate.in.cluster", "Ignoring the keepstate setting: the keepstate option is only supported in developer profile and not cluster profile."); ActionReport subReport = context.getActionReport().addSubActionsReport(); subReport.setActionExitCode(ActionReport.ExitCode.WARNING); subReport.setMessage(warningMsg); context.getLogger().log(Level.WARNING, warningMsg); } } }
appendTextChild(appNode, RuntimeTagNames.KEEP_STATE, String.valueOf(application.getKeepState()));
appendTextChild(appNode, RuntimeTagNames.KEEP_STATE, String.valueOf(application.getKeepState()));