diff --git a/flow-server/src/main/java/com/vaadin/flow/function/DeploymentConfiguration.java b/flow-server/src/main/java/com/vaadin/flow/function/DeploymentConfiguration.java index 3f69e2b6ce9..22aacf3efdc 100644 --- a/flow-server/src/main/java/com/vaadin/flow/function/DeploymentConfiguration.java +++ b/flow-server/src/main/java/com/vaadin/flow/function/DeploymentConfiguration.java @@ -166,26 +166,6 @@ public interface DeploymentConfiguration T getApplicationOrSystemProperty(String propertyName, T defaultValue, Function converter); - /** - * A shorthand of - * {@link DeploymentConfiguration#getApplicationOrSystemProperty(String, Object, Function)} - * for {@link String} type. - * - * @param propertyName - * The simple of the property, in some contexts, lookup might be - * performed using variations of the provided name. - * @param defaultValue - * the default value that should be used if no value has been - * defined - * @return the property value, or the passed default value if no property - * value is found - */ - @Override - default String getStringProperty(String propertyName, String defaultValue) { - return getApplicationOrSystemProperty(propertyName, defaultValue, - Function.identity()); - } - /** * A shorthand of * {@link DeploymentConfiguration#getApplicationOrSystemProperty(String, Object, Function)} @@ -297,9 +277,22 @@ default List getPolyfills() { } /** - * Get if the dev server should be reused on each reload. True by default, - * set it to false in tests so as dev server is not kept as a daemon after - * the test. + * <<<<<<< Upstream, based on master ======= Get if the dev server should be + * enabled. True by default + * + * @return true if dev server should be used + */ + @Override + default boolean enableDevServer() { + return getBooleanProperty( + InitParameters.SERVLET_PARAMETER_ENABLE_DEV_SERVER, true); + } + + /** + * >>>>>>> 01eb234 refactor: extract common config functionality and + * introduce add config Get if the dev server should be reused on each + * reload. True by default, set it to false in tests so as dev server is not + * kept as a daemon after the test. * * @return true if dev server should be reused */ diff --git a/flow-server/src/main/java/com/vaadin/flow/server/PropertyDeploymentConfiguration.java b/flow-server/src/main/java/com/vaadin/flow/server/PropertyDeploymentConfiguration.java index e2d95978044..6281cf30136 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/PropertyDeploymentConfiguration.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/PropertyDeploymentConfiguration.java @@ -22,6 +22,7 @@ import java.util.Properties; import com.vaadin.flow.function.DeploymentConfiguration; +import com.vaadin.flow.server.startup.ApplicationConfiguration; import com.vaadin.flow.shared.communication.PushMode; import static com.vaadin.flow.server.InitParameters.SERVLET_PARAMETER_CLOSE_IDLE_SESSIONS; @@ -47,7 +48,9 @@ public class PropertyDeploymentConfiguration /** * Create a new property deployment configuration instance. - * + * + * @param parentConfig + * a parent application configuration * @param systemPropertyBaseClass * the class that should be used as a basis when reading system * properties @@ -55,8 +58,9 @@ public class PropertyDeploymentConfiguration * the init parameters that should make up the foundation for * this configuration */ - public PropertyDeploymentConfiguration(Class systemPropertyBaseClass, - Properties initParameters) { + public PropertyDeploymentConfiguration( + ApplicationConfiguration parentConfig, + Class systemPropertyBaseClass, Properties initParameters) { super(filterStringProperties(initParameters)); initialParameters = initParameters; this.systemPropertyBaseClass = systemPropertyBaseClass; diff --git a/flow-server/src/main/java/com/vaadin/flow/server/startup/AbstractConfigurationFactory.java b/flow-server/src/main/java/com/vaadin/flow/server/startup/AbstractConfigurationFactory.java index 91c01ca7c41..1519f82c6da 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/startup/AbstractConfigurationFactory.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/startup/AbstractConfigurationFactory.java @@ -62,7 +62,7 @@ public class AbstractConfigurationFactory implements Serializable { * the token file data * @return the config parameters */ - public Map getConfigParametersUsingTokenData( + protected Map getConfigParametersUsingTokenData( JsonObject buildInfo) { Map params = new HashMap<>(); if (buildInfo.hasKey(SERVLET_PARAMETER_PRODUCTION_MODE)) { @@ -151,16 +151,6 @@ public Map getConfigParametersUsingTokenData( return params; } - /** - * Sets to the dev mode properties to the configuration parameters. - * - * @see #getConfigParametersUsingTokenData(JsonObject) - * - * @param params - * the configuration parameters to set dev mode properties to - * @param buildInfo - * the token file data - */ protected void setDevModePropertiesUsingTokenData( Map params, JsonObject buildInfo) { // read dev mode properties from the token and set init parameter only