com.vaadin
Class DefaultDeploymentConfiguration

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

public class DefaultDeploymentConfiguration
extends java.lang.Object
implements DeploymentConfiguration

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

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.
 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 isIdleUICleanupEnabled()
          Returns whether UIs that have no other activity than heartbeat requests should be removed from the session after they have been idle the maximum inactivity time enforced by the session.
 boolean isProductionMode()
          Returns whether Vaadin is in production mode.
 boolean isXsrfProtectionEnabled()
          Returns whether cross-site request forgery protection is enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.

Specified by:
getApplicationOrSystemProperty in interface DeploymentConfiguration
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.

Specified by:
isProductionMode in interface DeploymentConfiguration
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.

Specified by:
isXsrfProtectionEnabled in interface DeploymentConfiguration
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).

Specified by:
getResourceCacheTime in interface DeploymentConfiguration
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).

Specified by:
getHeartbeatInterval in interface DeploymentConfiguration
Returns:
The time between heartbeats.

isIdleUICleanupEnabled

public boolean isIdleUICleanupEnabled()
Description copied from interface: DeploymentConfiguration
Returns whether UIs that have no other activity than heartbeat requests should be removed from the session after they have been idle the maximum inactivity time enforced by the session.

Specified by:
isIdleUICleanupEnabled in interface DeploymentConfiguration
Returns:
True if UIs receiving only heartbeat requests are eventually removed; false if heartbeat requests extend UI lifetime indefinitely.
See Also:
WrappedSession.getMaxInactiveInterval()

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.

Specified by:
getInitParameters in interface DeploymentConfiguration
Returns:
properties for the application.


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