Package com.vaadin.server
Class DefaultDeploymentConfiguration
- java.lang.Object
-
- com.vaadin.server.AbstractDeploymentConfiguration
-
- com.vaadin.server.DefaultDeploymentConfiguration
-
- All Implemented Interfaces:
DeploymentConfiguration,Serializable
public class DefaultDeploymentConfiguration extends AbstractDeploymentConfiguration
The default implementation ofDeploymentConfigurationbased on a base class for resolving system properties and a set of init parameters.- Since:
- 7.0.0
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_CLOSE_IDLE_SESSIONSDefault value forisCloseIdleSessions()= false .static intDEFAULT_HEARTBEAT_INTERVALDefault value forgetHeartbeatInterval()= 300 .static intDEFAULT_RESOURCE_CACHE_TIMEDefault value forgetResourceCacheTime()= 3600 .static booleanDEFAULT_SEND_URLS_AS_PARAMETERSstatic booleanDEFAULT_SYNC_ID_CHECKDefault value forisSyncIdCheckEnabled()= true .
-
Constructor Summary
Constructors Constructor Description DefaultDeploymentConfiguration(Class<?> systemPropertyBaseClass, Properties initParameters)Create a new deployment configuration instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetApplicationOrSystemProperty(String propertyName, String defaultValue)Gets a configured property.StringgetApplicationProperty(String parameterName)Gets an application property value.intgetHeartbeatInterval()Returns the number of seconds between heartbeat requests of a UI, or a non-positive number if heartbeat is disabled.PropertiesgetInitParameters()Gets the properties configured for the deployment, e.g. as init parameters to the servlet or portlet.PushModegetPushMode()Returns the mode of bidirectional ("push") client-server communication that should be used.intgetResourceCacheTime()Returns the time resources can be cached in the browsers, in seconds.protected StringgetSystemProperty(String parameterName)Gets an system property value.booleanisCloseIdleSessions()Returns whether a session should be closed when all its open UIs have been idle for longer than its configured maximum inactivity time.booleanisProductionMode()Returns whether Vaadin is in production mode.booleanisSendUrlsAsParameters()Returns whether the sending of URL's as GET and POST parameters in requests with content-typeapplication/x-www-form-urlencodedis enabled or not.booleanisSyncIdCheckEnabled()Returns whether sync id checking is enabled.booleanisXsrfProtectionEnabled()Returns whether cross-site request forgery protection is enabled.-
Methods inherited from class com.vaadin.server.AbstractDeploymentConfiguration
getClassLoaderName, getResourcesPath, getUIClassName, getUIProviderClassName, getUIProviderPriority, getWidgetset
-
-
-
-
Field Detail
-
DEFAULT_RESOURCE_CACHE_TIME
public static final int DEFAULT_RESOURCE_CACHE_TIME
Default value forgetResourceCacheTime()= 3600 .- See Also:
- Constant Field Values
-
DEFAULT_HEARTBEAT_INTERVAL
public static final int DEFAULT_HEARTBEAT_INTERVAL
Default value forgetHeartbeatInterval()= 300 .- See Also:
- Constant Field Values
-
DEFAULT_CLOSE_IDLE_SESSIONS
public static final boolean DEFAULT_CLOSE_IDLE_SESSIONS
Default value forisCloseIdleSessions()= false .- See Also:
- Constant Field Values
-
DEFAULT_SYNC_ID_CHECK
public static final boolean DEFAULT_SYNC_ID_CHECK
Default value forisSyncIdCheckEnabled()= true .- Since:
- 7.3
- See Also:
- Constant Field Values
-
DEFAULT_SEND_URLS_AS_PARAMETERS
public static final boolean DEFAULT_SEND_URLS_AS_PARAMETERS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DefaultDeploymentConfiguration
public DefaultDeploymentConfiguration(Class<?> systemPropertyBaseClass, Properties initParameters)
Create a new deployment configuration instance.- Parameters:
systemPropertyBaseClass- the class that should be used as a basis when reading system propertiesinitParameters- the init parameters that should make up the foundation for this configuration
-
-
Method Detail
-
getApplicationOrSystemProperty
public String getApplicationOrSystemProperty(String propertyName, String defaultValue)
Description copied from interface:DeploymentConfigurationGets a configured property. The properties are typically read from e.g. web.xml or from system properties of the JVM.- Parameters:
propertyName- The simple of the property, in some contexts, lookup might be performed using variations of the provided name.defaultValue- the default value that should be used if no value has been defined- Returns:
- the property value, or the passed default value if no property value is found
-
getSystemProperty
protected String getSystemProperty(String parameterName)
Gets an system property value.- Parameters:
parameterName- the Name or the parameter.- Returns:
- String value or null if not found
-
getApplicationProperty
public String getApplicationProperty(String parameterName)
Gets an application property value.- Parameters:
parameterName- the Name or the parameter.- Returns:
- String value or null if not found
-
isProductionMode
public boolean isProductionMode()
Returns whether Vaadin is in production mode. The default is false.- Returns:
- true if in production mode, false otherwise.
-
isXsrfProtectionEnabled
public boolean isXsrfProtectionEnabled()
Returns whether cross-site request forgery protection is enabled.The default is true.
- Returns:
- true if XSRF protection is enabled, false otherwise.
-
getResourceCacheTime
public int getResourceCacheTime()
Returns the time resources can be cached in the browsers, in seconds.The default interval is 3600 seconds (1 hour).
- Returns:
- The resource cache time.
-
getHeartbeatInterval
public int getHeartbeatInterval()
Returns the number of seconds between heartbeat requests of a UI, or a non-positive number if heartbeat is disabled.The default interval is 300 seconds (5 minutes).
- Returns:
- The time between heartbeats.
-
isCloseIdleSessions
public boolean isCloseIdleSessions()
Returns whether a session should be closed when all its open UIs have been idle for longer than its configured maximum inactivity time.A UI is idle if it is open on the client side but has no activity other than heartbeat requests. If
isCloseIdleSessions() == false, heartbeat requests cause the session to stay open for as long as there are open UIs on the client side. If it istrue, the session is eventually closed if the open UIs do not have any user interaction.The default value is false.
- Returns:
- True if UIs and sessions receiving only heartbeat requests are eventually closed; false if heartbeat requests extend UI and session lifetime indefinitely.
- See Also:
WrappedSession.getMaxInactiveInterval()
-
isSyncIdCheckEnabled
public boolean isSyncIdCheckEnabled()
Returns whether sync id checking is enabled. The sync id is used to gracefully handle situations when the client sends a message to a connector that has recently been removed on the server.The default value is
true.- Returns:
trueif sync id checking is enabled;falseotherwise
-
isSendUrlsAsParameters
public boolean isSendUrlsAsParameters()
Returns whether the sending of URL's as GET and POST parameters in requests with content-typeapplication/x-www-form-urlencodedis enabled or not.The default value is
true.- Returns:
falseif set to false ortrueotherwise
-
getPushMode
public PushMode getPushMode()
Returns the mode of bidirectional ("push") client-server communication that should be used.The default mode is
PushMode.DISABLED.- Returns:
- The push mode in use.
-
getInitParameters
public Properties getInitParameters()
Description copied from interface:DeploymentConfigurationGets the properties configured for the deployment, e.g. as init parameters to the servlet or portlet.- Returns:
- properties for the application.
-
-