com.vaadin.server
Class DefaultDeploymentConfiguration

java.lang.Object
  extended by com.vaadin.server.AbstractDeploymentConfiguration
      extended by com.vaadin.server.DefaultDeploymentConfiguration
All Implemented Interfaces:
DeploymentConfiguration, java.io.Serializable

public class DefaultDeploymentConfiguration
extends AbstractDeploymentConfiguration

The default implementation of DeploymentConfiguration based 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

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.vaadin.server.DeploymentConfiguration
DeploymentConfiguration.LegacyProperyToStringMode
 
Field Summary
static boolean DEFAULT_CLOSE_IDLE_SESSIONS
          Default value for isCloseIdleSessions() = false .
static int DEFAULT_HEARTBEAT_INTERVAL
          Default value for getHeartbeatInterval() = 300 .
static DeploymentConfiguration.LegacyProperyToStringMode DEFAULT_LEGACY_PROPERTY_TO_STRING
          Default value for getLegacyPropertyToStringMode() = LegacyProperyToStringMode#WARNING.
static int DEFAULT_RESOURCE_CACHE_TIME
          Default value for getResourceCacheTime() = 3600 .
static boolean DEFAULT_SEND_URLS_AS_PARAMETERS
           
static boolean DEFAULT_SYNC_ID_CHECK
          Default value for isSyncIdCheckEnabled() = true .
 
Constructor Summary
DefaultDeploymentConfiguration(java.lang.Class<?> systemPropertyBaseClass, java.util.Properties initParameters)
          Create a new deployment configuration instance.
 
Method Summary
 java.lang.String getApplicationOrSystemProperty(java.lang.String propertyName, java.lang.String defaultValue)
          Gets a configured property.
 java.lang.String getApplicationProperty(java.lang.String parameterName)
          Gets an application property value.
 int getHeartbeatInterval()
          Returns the number of seconds between heartbeat requests of a UI, or a non-positive number if heartbeat is disabled.
 java.util.Properties getInitParameters()
          Gets the properties configured for the deployment, e.g.
 DeploymentConfiguration.LegacyProperyToStringMode getLegacyPropertyToStringMode()
          Deprecated. 
 com.vaadin.shared.communication.PushMode getPushMode()
          Returns the mode of bidirectional ("push") client-server communication that should be used.
 int getResourceCacheTime()
          Returns the time resources can be cached in the browsers, in seconds.
protected  java.lang.String getSystemProperty(java.lang.String parameterName)
          Gets an system property value.
 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.
 boolean isProductionMode()
          Returns whether Vaadin is in production mode.
 boolean isSendUrlsAsParameters()
          Returns whether the sending of URL's as GET and POST parameters in requests with content-type application/x-www-form-urlencoded is enabled or not.
 boolean isSyncIdCheckEnabled()
          Returns whether sync id checking is enabled.
 boolean isXsrfProtectionEnabled()
          Returns whether cross-site request forgery protection is enabled.
 
Methods inherited from class com.vaadin.server.AbstractDeploymentConfiguration
getClassLoaderName, getResourcesPath, getUIClassName, getUIProviderClassName, getWidgetset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_RESOURCE_CACHE_TIME

public static final int DEFAULT_RESOURCE_CACHE_TIME
Default value for getResourceCacheTime() = 3600 .

See Also:
Constant Field Values

DEFAULT_HEARTBEAT_INTERVAL

public static final int DEFAULT_HEARTBEAT_INTERVAL
Default value for getHeartbeatInterval() = 300 .

See Also:
Constant Field Values

DEFAULT_CLOSE_IDLE_SESSIONS

public static final boolean DEFAULT_CLOSE_IDLE_SESSIONS
Default value for isCloseIdleSessions() = false .

See Also:
Constant Field Values

DEFAULT_LEGACY_PROPERTY_TO_STRING

public static final DeploymentConfiguration.LegacyProperyToStringMode DEFAULT_LEGACY_PROPERTY_TO_STRING
Default value for getLegacyPropertyToStringMode() = LegacyProperyToStringMode#WARNING.


DEFAULT_SYNC_ID_CHECK

public static final boolean DEFAULT_SYNC_ID_CHECK
Default value for isSyncIdCheckEnabled() = 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(java.lang.Class<?> systemPropertyBaseClass,
                                      java.util.Properties initParameters)
Create a new deployment configuration instance.

Parameters:
systemPropertyBaseClass - the class that should be used as a basis when reading system properties
initParameters - the init parameters that should make up the foundation for this configuration
Method Detail

getApplicationOrSystemProperty

public java.lang.String getApplicationOrSystemProperty(java.lang.String propertyName,
                                                       java.lang.String defaultValue)
Description copied from interface: DeploymentConfiguration
Gets 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 java.lang.String getSystemProperty(java.lang.String parameterName)
Gets an system property value.

Parameters:
parameterName - the Name or the parameter.
Returns:
String value or null if not found

getApplicationProperty

public java.lang.String getApplicationProperty(java.lang.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 is true, 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:
true if sync id checking is enabled; false otherwise

isSendUrlsAsParameters

public boolean isSendUrlsAsParameters()
Returns whether the sending of URL's as GET and POST parameters in requests with content-type application/x-www-form-urlencoded is enabled or not.

The default value is true.

Returns:
false if set to false or true otherwise

getPushMode

public com.vaadin.shared.communication.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 java.util.Properties getInitParameters()
Description copied from interface: DeploymentConfiguration
Gets the properties configured for the deployment, e.g. as init parameters to the servlet or portlet.

Returns:
properties for the application.

getLegacyPropertyToStringMode

@Deprecated
public DeploymentConfiguration.LegacyProperyToStringMode getLegacyPropertyToStringMode()
Deprecated. 

Description copied from interface: DeploymentConfiguration
Returns to legacy Property.toString() mode used. See AbstractProperty#isLegacyToStringEnabled() for more information.

Returns:
The Property.toString() mode in use.


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.