Skip to content

Commit

Permalink
Merge pull request #6526 from jGauravGupta/FISH-8152
Browse files Browse the repository at this point in the history
FISH-8152 Micro Maven - Devmode - Store session state
  • Loading branch information
jGauravGupta authored Jan 24, 2024
2 parents 10791ff + e80f0f9 commit 5afb117
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2016-2020] [Payara Foundation and/or its affiliates]
// Portions Copyright [2016-2024] [Payara Foundation and/or its affiliates]

package org.glassfish.api.deployment;

Expand Down Expand Up @@ -303,6 +303,7 @@ public static class ParameterNames {
public static final String DEPLOYMENT_ORDER = "deploymentorder";
public static final String ALT_DD = "altdd";
public static final String RUNTIME_ALT_DD = "runtimealtdd";
public static final String KEEP_STATE = "keepState";
public static final String HOT_DEPLOY = "hotdeploy";
public static final String SOURCES_CHANGED = "sourceschanged";
public static final String METADATA_CHANGED = "metadatachanged";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2016-2021] [Payara Foundation and/or its affiliates]
// Portions Copyright [2016-2024] [Payara Foundation and/or its affiliates]

package com.sun.enterprise.v3.server;

Expand All @@ -48,7 +48,6 @@
import com.sun.enterprise.admin.report.XMLActionReporter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
Expand All @@ -61,7 +60,6 @@
import java.util.Properties;
import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.security.auth.Subject;
import org.glassfish.api.admin.ParameterMap;
Expand Down Expand Up @@ -251,6 +249,7 @@ private void reloadApp(AppReloadInfo appInfo) throws IOException {
deployParam.set(DeploymentProperties.KEEP_REPOSITORY_DIRECTORY, "true");

Properties reloadFile = appInfo.readReloadFile();
boolean keepState = Boolean.parseBoolean(reloadFile.getProperty(DeployCommandParameters.ParameterNames.KEEP_STATE));
boolean hotDeploy = Boolean.parseBoolean(reloadFile.getProperty(DeployCommandParameters.ParameterNames.HOT_DEPLOY));
if (hotDeploy) {
deployParam.set(DeployCommandParameters.ParameterNames.HOT_DEPLOY, "true");
Expand All @@ -263,6 +262,9 @@ private void reloadApp(AppReloadInfo appInfo) throws IOException {
deployParam.set(DeployCommandParameters.ParameterNames.SOURCES_CHANGED, sourcesChanged);
}
}
if(keepState) {
deployParam.set(DeployCommandParameters.ParameterNames.KEEP_STATE, "true");
}
commandRunner.getCommandInvocation("deploy", new XMLActionReporter(), kernelSubject).parameters(deployParam).execute();

appInfo.recordLoad();
Expand Down

0 comments on commit 5afb117

Please sign in to comment.