]> source.dussan.org Git - vaadin-framework.git/commitdiff
Rename ApplicationConfiguration -> DeploymentConfiguration (#9402)
authorLeif Åstrand <leif@vaadin.com>
Thu, 6 Sep 2012 07:57:39 +0000 (10:57 +0300)
committerLeif Åstrand <leif@vaadin.com>
Thu, 6 Sep 2012 07:58:14 +0000 (10:58 +0300)
15 files changed:
server/src/com/vaadin/DefaultApplicationConfiguration.java [deleted file]
server/src/com/vaadin/DefaultDeploymentConfiguration.java [new file with mode: 0644]
server/src/com/vaadin/server/AbstractVaadinService.java
server/src/com/vaadin/server/ApplicationConfiguration.java [deleted file]
server/src/com/vaadin/server/BootstrapHandler.java
server/src/com/vaadin/server/DeploymentConfiguration.java [new file with mode: 0644]
server/src/com/vaadin/server/PortletCommunicationManager.java
server/src/com/vaadin/server/ServletPortletHelper.java
server/src/com/vaadin/server/VaadinPortlet.java
server/src/com/vaadin/server/VaadinService.java
server/src/com/vaadin/server/VaadinServlet.java
server/src/com/vaadin/server/VaadinSession.java
server/tests/src/com/vaadin/server/TestAbstractApplicationServletStaticFilesLocation.java
server/tests/src/com/vaadin/tests/server/component/root/CustomUIClassLoader.java
uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java

diff --git a/server/src/com/vaadin/DefaultApplicationConfiguration.java b/server/src/com/vaadin/DefaultApplicationConfiguration.java
deleted file mode 100644 (file)
index 2e22671..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin;
-
-import java.util.Properties;
-import java.util.logging.Logger;
-
-import com.vaadin.server.ApplicationConfiguration;
-import com.vaadin.server.Constants;
-
-public class DefaultApplicationConfiguration implements
-        ApplicationConfiguration {
-    private final Properties applicationProperties;
-    private boolean productionMode;
-    private boolean xsrfProtectionEnabled;
-    private int resourceCacheTime;
-    private int heartbeatInterval;
-    private boolean idleRootCleanupEnabled;
-    private final Class<?> systemPropertyBaseClass;
-
-    public DefaultApplicationConfiguration(Class<?> systemPropertyBaseClass,
-            Properties applicationProperties) {
-        this.applicationProperties = applicationProperties;
-        this.systemPropertyBaseClass = systemPropertyBaseClass;
-
-        checkProductionMode();
-        checkXsrfProtection();
-        checkResourceCacheTime();
-        checkHeartbeatInterval();
-        checkIdleUICleanup();
-    }
-
-    @Override
-    public String getApplicationOrSystemProperty(String propertyName,
-            String defaultValue) {
-        String val = null;
-
-        // Try application properties
-        val = getApplicationProperty(propertyName);
-        if (val != null) {
-            return val;
-        }
-
-        // Try system properties
-        val = getSystemProperty(propertyName);
-        if (val != null) {
-            return val;
-        }
-
-        return defaultValue;
-    }
-
-    /**
-     * Gets an system property value.
-     * 
-     * @param parameterName
-     *            the Name or the parameter.
-     * @return String value or null if not found
-     */
-    protected String getSystemProperty(String parameterName) {
-        String val = null;
-
-        String pkgName;
-        final Package pkg = systemPropertyBaseClass.getPackage();
-        if (pkg != null) {
-            pkgName = pkg.getName();
-        } else {
-            final String className = systemPropertyBaseClass.getName();
-            pkgName = new String(className.toCharArray(), 0,
-                    className.lastIndexOf('.'));
-        }
-        val = System.getProperty(pkgName + "." + parameterName);
-        if (val != null) {
-            return val;
-        }
-
-        // Try lowercased system properties
-        val = System.getProperty(pkgName + "." + parameterName.toLowerCase());
-        return val;
-    }
-
-    /**
-     * Gets an application property value.
-     * 
-     * @param parameterName
-     *            the Name or the parameter.
-     * @return String value or null if not found
-     */
-    public String getApplicationProperty(String parameterName) {
-
-        String val = applicationProperties.getProperty(parameterName);
-        if (val != null) {
-            return val;
-        }
-
-        // Try lower case application properties for backward compatibility with
-        // 3.0.2 and earlier
-        val = applicationProperties.getProperty(parameterName.toLowerCase());
-
-        return val;
-    }
-
-    /**
-     * {@inheritDoc}
-     * 
-     * The default is false.
-     */
-    @Override
-    public boolean isProductionMode() {
-        return productionMode;
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p>
-     * The default is true.
-     */
-    @Override
-    public boolean isXsrfProtectionEnabled() {
-        return xsrfProtectionEnabled;
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p>
-     * The default interval is 3600 seconds (1 hour).
-     */
-    @Override
-    public int getResourceCacheTime() {
-        return resourceCacheTime;
-    }
-
-    /**
-     * {@inheritDoc}
-     * <p>
-     * The default interval is 300 seconds (5 minutes).
-     */
-    @Override
-    public int getHeartbeatInterval() {
-        return heartbeatInterval;
-    }
-
-    @Override
-    public boolean isIdleUICleanupEnabled() {
-        return idleRootCleanupEnabled;
-    }
-
-    /**
-     * Log a warning if Vaadin is not running in production mode.
-     */
-    private void checkProductionMode() {
-        productionMode = getApplicationOrSystemProperty(
-                Constants.SERVLET_PARAMETER_PRODUCTION_MODE, "false").equals(
-                "true");
-        if (!productionMode) {
-            getLogger().warning(Constants.NOT_PRODUCTION_MODE_INFO);
-        }
-    }
-
-    /**
-     * Log a warning if cross-site request forgery protection is disabled.
-     */
-    private void checkXsrfProtection() {
-        xsrfProtectionEnabled = !getApplicationOrSystemProperty(
-                Constants.SERVLET_PARAMETER_DISABLE_XSRF_PROTECTION, "false")
-                .equals("true");
-        if (!xsrfProtectionEnabled) {
-            getLogger().warning(Constants.WARNING_XSRF_PROTECTION_DISABLED);
-        }
-    }
-
-    /**
-     * Log a warning if resource cache time is set but is not an integer.
-     */
-    private void checkResourceCacheTime() {
-        try {
-            resourceCacheTime = Integer
-                    .parseInt(getApplicationOrSystemProperty(
-                            Constants.SERVLET_PARAMETER_RESOURCE_CACHE_TIME,
-                            "3600"));
-        } catch (NumberFormatException e) {
-            getLogger().warning(
-                    Constants.WARNING_RESOURCE_CACHING_TIME_NOT_NUMERIC);
-            resourceCacheTime = 3600;
-        }
-    }
-
-    private void checkHeartbeatInterval() {
-        try {
-            heartbeatInterval = Integer
-                    .parseInt(getApplicationOrSystemProperty(
-                            Constants.SERVLET_PARAMETER_HEARTBEAT_RATE, "300"));
-        } catch (NumberFormatException e) {
-            getLogger().warning(
-                    Constants.WARNING_HEARTBEAT_INTERVAL_NOT_NUMERIC);
-            heartbeatInterval = 300;
-        }
-    }
-
-    private void checkIdleUICleanup() {
-        idleRootCleanupEnabled = getApplicationOrSystemProperty(
-                Constants.SERVLET_PARAMETER_CLOSE_IDLE_UIS, "false").equals(
-                "true");
-    }
-
-    private Logger getLogger() {
-        return Logger.getLogger(getClass().getName());
-    }
-
-    @Override
-    public Properties getInitParameters() {
-        return applicationProperties;
-    }
-
-}
diff --git a/server/src/com/vaadin/DefaultDeploymentConfiguration.java b/server/src/com/vaadin/DefaultDeploymentConfiguration.java
new file mode 100644 (file)
index 0000000..6159137
--- /dev/null
@@ -0,0 +1,228 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin;
+
+import java.util.Properties;
+import java.util.logging.Logger;
+
+import com.vaadin.server.Constants;
+import com.vaadin.server.DeploymentConfiguration;
+
+public class DefaultDeploymentConfiguration implements DeploymentConfiguration {
+    private final Properties initParameters;
+    private boolean productionMode;
+    private boolean xsrfProtectionEnabled;
+    private int resourceCacheTime;
+    private int heartbeatInterval;
+    private boolean idleRootCleanupEnabled;
+    private final Class<?> systemPropertyBaseClass;
+
+    public DefaultDeploymentConfiguration(Class<?> systemPropertyBaseClass,
+            Properties initParameters) {
+        this.initParameters = initParameters;
+        this.systemPropertyBaseClass = systemPropertyBaseClass;
+
+        checkProductionMode();
+        checkXsrfProtection();
+        checkResourceCacheTime();
+        checkHeartbeatInterval();
+        checkIdleUICleanup();
+    }
+
+    @Override
+    public String getApplicationOrSystemProperty(String propertyName,
+            String defaultValue) {
+        String val = null;
+
+        // Try application properties
+        val = getApplicationProperty(propertyName);
+        if (val != null) {
+            return val;
+        }
+
+        // Try system properties
+        val = getSystemProperty(propertyName);
+        if (val != null) {
+            return val;
+        }
+
+        return defaultValue;
+    }
+
+    /**
+     * Gets an system property value.
+     * 
+     * @param parameterName
+     *            the Name or the parameter.
+     * @return String value or null if not found
+     */
+    protected String getSystemProperty(String parameterName) {
+        String val = null;
+
+        String pkgName;
+        final Package pkg = systemPropertyBaseClass.getPackage();
+        if (pkg != null) {
+            pkgName = pkg.getName();
+        } else {
+            final String className = systemPropertyBaseClass.getName();
+            pkgName = new String(className.toCharArray(), 0,
+                    className.lastIndexOf('.'));
+        }
+        val = System.getProperty(pkgName + "." + parameterName);
+        if (val != null) {
+            return val;
+        }
+
+        // Try lowercased system properties
+        val = System.getProperty(pkgName + "." + parameterName.toLowerCase());
+        return val;
+    }
+
+    /**
+     * Gets an application property value.
+     * 
+     * @param parameterName
+     *            the Name or the parameter.
+     * @return String value or null if not found
+     */
+    public String getApplicationProperty(String parameterName) {
+
+        String val = initParameters.getProperty(parameterName);
+        if (val != null) {
+            return val;
+        }
+
+        // Try lower case application properties for backward compatibility with
+        // 3.0.2 and earlier
+        val = initParameters.getProperty(parameterName.toLowerCase());
+
+        return val;
+    }
+
+    /**
+     * {@inheritDoc}
+     * 
+     * The default is false.
+     */
+    @Override
+    public boolean isProductionMode() {
+        return productionMode;
+    }
+
+    /**
+     * {@inheritDoc}
+     * <p>
+     * The default is true.
+     */
+    @Override
+    public boolean isXsrfProtectionEnabled() {
+        return xsrfProtectionEnabled;
+    }
+
+    /**
+     * {@inheritDoc}
+     * <p>
+     * The default interval is 3600 seconds (1 hour).
+     */
+    @Override
+    public int getResourceCacheTime() {
+        return resourceCacheTime;
+    }
+
+    /**
+     * {@inheritDoc}
+     * <p>
+     * The default interval is 300 seconds (5 minutes).
+     */
+    @Override
+    public int getHeartbeatInterval() {
+        return heartbeatInterval;
+    }
+
+    @Override
+    public boolean isIdleUICleanupEnabled() {
+        return idleRootCleanupEnabled;
+    }
+
+    /**
+     * Log a warning if Vaadin is not running in production mode.
+     */
+    private void checkProductionMode() {
+        productionMode = getApplicationOrSystemProperty(
+                Constants.SERVLET_PARAMETER_PRODUCTION_MODE, "false").equals(
+                "true");
+        if (!productionMode) {
+            getLogger().warning(Constants.NOT_PRODUCTION_MODE_INFO);
+        }
+    }
+
+    /**
+     * Log a warning if cross-site request forgery protection is disabled.
+     */
+    private void checkXsrfProtection() {
+        xsrfProtectionEnabled = !getApplicationOrSystemProperty(
+                Constants.SERVLET_PARAMETER_DISABLE_XSRF_PROTECTION, "false")
+                .equals("true");
+        if (!xsrfProtectionEnabled) {
+            getLogger().warning(Constants.WARNING_XSRF_PROTECTION_DISABLED);
+        }
+    }
+
+    /**
+     * Log a warning if resource cache time is set but is not an integer.
+     */
+    private void checkResourceCacheTime() {
+        try {
+            resourceCacheTime = Integer
+                    .parseInt(getApplicationOrSystemProperty(
+                            Constants.SERVLET_PARAMETER_RESOURCE_CACHE_TIME,
+                            "3600"));
+        } catch (NumberFormatException e) {
+            getLogger().warning(
+                    Constants.WARNING_RESOURCE_CACHING_TIME_NOT_NUMERIC);
+            resourceCacheTime = 3600;
+        }
+    }
+
+    private void checkHeartbeatInterval() {
+        try {
+            heartbeatInterval = Integer
+                    .parseInt(getApplicationOrSystemProperty(
+                            Constants.SERVLET_PARAMETER_HEARTBEAT_RATE, "300"));
+        } catch (NumberFormatException e) {
+            getLogger().warning(
+                    Constants.WARNING_HEARTBEAT_INTERVAL_NOT_NUMERIC);
+            heartbeatInterval = 300;
+        }
+    }
+
+    private void checkIdleUICleanup() {
+        idleRootCleanupEnabled = getApplicationOrSystemProperty(
+                Constants.SERVLET_PARAMETER_CLOSE_IDLE_UIS, "false").equals(
+                "true");
+    }
+
+    private Logger getLogger() {
+        return Logger.getLogger(getClass().getName());
+    }
+
+    @Override
+    public Properties getInitParameters() {
+        return initParameters;
+    }
+
+}
index 516ce233338e2066046d0da5fe7b640c48a94e3d..dc6342b2994c1bf735d2d582dab001409bc3c82e 100644 (file)
@@ -23,21 +23,20 @@ import java.util.ServiceLoader;
 public abstract class AbstractVaadinService implements VaadinService {
 
     private AddonContext addonContext;
-    private final ApplicationConfiguration applicationConfiguration;
+    private final DeploymentConfiguration deploymentConfiguration;
 
-    public AbstractVaadinService(
-            ApplicationConfiguration applicationConfiguration) {
-        this.applicationConfiguration = applicationConfiguration;
+    public AbstractVaadinService(DeploymentConfiguration deploymentConfiguration) {
+        this.deploymentConfiguration = deploymentConfiguration;
     }
 
     @Override
-    public ApplicationConfiguration getApplicationConfiguration() {
-        return applicationConfiguration;
+    public DeploymentConfiguration getDeploymentConfiguration() {
+        return deploymentConfiguration;
     }
 
     @Override
     public ClassLoader getClassLoader() {
-        final String classLoaderName = getApplicationConfiguration()
+        final String classLoaderName = getDeploymentConfiguration()
                 .getApplicationOrSystemProperty("ClassLoader", null);
         ClassLoader classLoader;
         if (classLoaderName == null) {
diff --git a/server/src/com/vaadin/server/ApplicationConfiguration.java b/server/src/com/vaadin/server/ApplicationConfiguration.java
deleted file mode 100644 (file)
index dfb202f..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright 2011 Vaadin Ltd.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package com.vaadin.server;
-
-import java.util.Properties;
-
-/**
- * A collection of properties configured for all applications as well as a way
- * of accessing third party properties not explicitely supported by this class.
- * 
- * @author Vaadin Ltd
- * @version @VERSION@
- * @since 7.0.0
- */
-public interface ApplicationConfiguration {
-    /**
-     * Returns whether Vaadin is in production mode.
-     * 
-     * @return true if in production mode, false otherwise.
-     */
-    public boolean isProductionMode();
-
-    /**
-     * Returns whether cross-site request forgery protection is enabled.
-     * 
-     * @return true if XSRF protection is enabled, false otherwise.
-     */
-    public boolean isXsrfProtectionEnabled();
-
-    /**
-     * Returns the time resources can be cached in the browsers, in seconds.
-     * 
-     * @return The resource cache time.
-     */
-    public int getResourceCacheTime();
-
-    /**
-     * Returns the number of seconds between heartbeat requests of a UI, or a
-     * non-positive number if heartbeat is disabled.
-     * 
-     * @return The time between heartbeats.
-     */
-    public int getHeartbeatInterval();
-
-    /**
-     * Returns whether UIs that have no other activity than heartbeat requests
-     * should be closed after they have been idle the maximum inactivity time
-     * enforced by the session.
-     * 
-     * @see WrappedSession#getMaxInactiveInterval()
-     * 
-     * @since 7.0.0
-     * 
-     * @return True if UIs receiving only heartbeat requests are eventually
-     *         closed; false if heartbeat requests extend UI lifetime
-     *         indefinitely.
-     */
-    public boolean isIdleUICleanupEnabled();
-
-    /**
-     * Gets the properties configured for the deployment, e.g. as init
-     * parameters to the servlet or portlet.
-     * 
-     * @return properties for the application.
-     */
-    public Properties getInitParameters();
-
-    /**
-     * Gets a configured property. The properties are typically read from e.g.
-     * web.xml or from system properties of the JVM.
-     * 
-     * @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
-     */
-    public String getApplicationOrSystemProperty(String propertyName,
-            String defaultValue);
-
-}
index 37b9649e555d4632e9d34b6749cb7214f25eb823..4ebac73b6b5543e95c0047f0bbaa41663fee0f6c 100644 (file)
@@ -459,7 +459,7 @@ public abstract class BootstrapHandler implements RequestHandler {
         }
 
         defaults.put("heartbeatInterval", vaadinService
-                .getApplicationConfiguration().getHeartbeatInterval());
+                .getDeploymentConfiguration().getHeartbeatInterval());
 
         defaults.put("appUri", getAppUri(context));
 
diff --git a/server/src/com/vaadin/server/DeploymentConfiguration.java b/server/src/com/vaadin/server/DeploymentConfiguration.java
new file mode 100644 (file)
index 0000000..0333091
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2011 Vaadin Ltd.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package com.vaadin.server;
+
+import java.io.Serializable;
+import java.util.Properties;
+
+/**
+ * A collection of properties configured at deploy time as well as a way of
+ * accessing third party properties not explicitly supported by this class.
+ * 
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+public interface DeploymentConfiguration extends Serializable {
+    /**
+     * Returns whether Vaadin is in production mode.
+     * 
+     * @return true if in production mode, false otherwise.
+     */
+    public boolean isProductionMode();
+
+    /**
+     * Returns whether cross-site request forgery protection is enabled.
+     * 
+     * @return true if XSRF protection is enabled, false otherwise.
+     */
+    public boolean isXsrfProtectionEnabled();
+
+    /**
+     * Returns the time resources can be cached in the browsers, in seconds.
+     * 
+     * @return The resource cache time.
+     */
+    public int getResourceCacheTime();
+
+    /**
+     * Returns the number of seconds between heartbeat requests of a UI, or a
+     * non-positive number if heartbeat is disabled.
+     * 
+     * @return The time between heartbeats.
+     */
+    public int getHeartbeatInterval();
+
+    /**
+     * Returns whether UIs that have no other activity than heartbeat requests
+     * should be closed after they have been idle the maximum inactivity time
+     * enforced by the session.
+     * 
+     * @see WrappedSession#getMaxInactiveInterval()
+     * 
+     * @since 7.0.0
+     * 
+     * @return True if UIs receiving only heartbeat requests are eventually
+     *         closed; false if heartbeat requests extend UI lifetime
+     *         indefinitely.
+     */
+    public boolean isIdleUICleanupEnabled();
+
+    /**
+     * Gets the properties configured for the deployment, e.g. as init
+     * parameters to the servlet or portlet.
+     * 
+     * @return properties for the application.
+     */
+    public Properties getInitParameters();
+
+    /**
+     * Gets a configured property. The properties are typically read from e.g.
+     * web.xml or from system properties of the JVM.
+     * 
+     * @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
+     */
+    public String getApplicationOrSystemProperty(String propertyName,
+            String defaultValue);
+
+}
index 5b6948e2e32923db23640cb07f8afcca51eb77ec..fe22ea770ebdbb3efb1a1c19fca4ea464dcef2fe 100644 (file)
@@ -129,7 +129,7 @@ public class PortletCommunicationManager extends AbstractCommunicationManager {
             protected String getMainDivStyle(BootstrapContext context) {
                 VaadinService vaadinService = context.getRequest()
                         .getVaadinService();
-                return vaadinService.getApplicationConfiguration()
+                return vaadinService.getDeploymentConfiguration()
                         .getApplicationOrSystemProperty(
                                 VaadinPortlet.PORTLET_PARAMETER_STYLE, null);
             }
index f964415fdcdec967a5d059ce7331e8ffa4c71ff0..e7e4c813cec23a90871829b5389c7c2b01ddfa60 100644 (file)
@@ -43,7 +43,7 @@ class ServletPortletHelper implements Serializable {
 
     static Class<? extends Application> getLegacyApplicationClass(
             VaadinService vaadinService) throws ApplicationClassException {
-        Properties initParameters = vaadinService.getApplicationConfiguration()
+        Properties initParameters = vaadinService.getDeploymentConfiguration()
                 .getInitParameters();
         String applicationParameter = initParameters.getProperty("application");
         ClassLoader classLoader = vaadinService.getClassLoader();
@@ -133,7 +133,7 @@ class ServletPortletHelper implements Serializable {
 
     public static void initDefaultUIProvider(VaadinSession application,
             VaadinService vaadinService) throws ApplicationClassException {
-        String uiProperty = vaadinService.getApplicationConfiguration()
+        String uiProperty = vaadinService.getDeploymentConfiguration()
                 .getInitParameters().getProperty(VaadinSession.UI_PARAMETER);
         if (uiProperty != null) {
             verifyUIClass(uiProperty, vaadinService.getClassLoader());
index be571fbf6045a1bcbc5ba672ee60c63e42fcd07a..4c902252c9d403c63cce8bdff8a0cbd8530bb6c9 100644 (file)
@@ -55,7 +55,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import com.liferay.portal.kernel.util.PortalClassInvoker;
 import com.liferay.portal.kernel.util.PropsUtil;
-import com.vaadin.DefaultApplicationConfiguration;
+import com.vaadin.DefaultDeploymentConfiguration;
 import com.vaadin.server.AbstractCommunicationManager.Callback;
 import com.vaadin.server.ServletPortletHelper.ApplicationClassException;
 import com.vaadin.server.VaadinSession.ApplicationStartEvent;
@@ -78,8 +78,8 @@ public class VaadinPortlet extends GenericPortlet implements Constants {
         private final VaadinPortlet portlet;
 
         public PortletService(VaadinPortlet portlet,
-                ApplicationConfiguration applicationConfiguration) {
-            super(applicationConfiguration);
+                DeploymentConfiguration deploymentConfiguration) {
+            super(deploymentConfiguration);
             this.portlet = portlet;
         }
 
@@ -90,7 +90,7 @@ public class VaadinPortlet extends GenericPortlet implements Constants {
         @Override
         public String getConfiguredWidgetset(WrappedRequest request) {
 
-            String widgetset = getApplicationConfiguration()
+            String widgetset = getDeploymentConfiguration()
                     .getApplicationOrSystemProperty(PARAMETER_WIDGETSET, null);
 
             if (widgetset == null) {
@@ -324,41 +324,38 @@ public class VaadinPortlet extends GenericPortlet implements Constants {
     @Override
     public void init(PortletConfig config) throws PortletException {
         super.init(config);
-        Properties applicationProperties = new Properties();
+        Properties initParameters = new Properties();
 
         // Read default parameters from the context
         final PortletContext context = config.getPortletContext();
         for (final Enumeration<String> e = context.getInitParameterNames(); e
                 .hasMoreElements();) {
             final String name = e.nextElement();
-            applicationProperties.setProperty(name,
-                    context.getInitParameter(name));
+            initParameters.setProperty(name, context.getInitParameter(name));
         }
 
         // Override with application settings from portlet.xml
         for (final Enumeration<String> e = config.getInitParameterNames(); e
                 .hasMoreElements();) {
             final String name = e.nextElement();
-            applicationProperties.setProperty(name,
-                    config.getInitParameter(name));
+            initParameters.setProperty(name, config.getInitParameter(name));
         }
 
-        ApplicationConfiguration applicationConfiguration = createApplicationConfiguration(applicationProperties);
-        vaadinService = createPortletService(applicationConfiguration);
+        DeploymentConfiguration deploymentConfiguration = createDeploymentConfiguration(initParameters);
+        vaadinService = createPortletService(deploymentConfiguration);
 
         addonContext = new AddonContext(vaadinService);
         addonContext.init();
     }
 
-    protected ApplicationConfiguration createApplicationConfiguration(
-            Properties applicationProperties) {
-        return new DefaultApplicationConfiguration(getClass(),
-                applicationProperties);
+    protected DeploymentConfiguration createDeploymentConfiguration(
+            Properties initParameters) {
+        return new DefaultDeploymentConfiguration(getClass(), initParameters);
     }
 
     protected PortletService createPortletService(
-            ApplicationConfiguration applicationConfiguration) {
-        return new PortletService(this, applicationConfiguration);
+            DeploymentConfiguration deploymentConfiguration) {
+        return new PortletService(this, deploymentConfiguration);
     }
 
     @Override
@@ -830,8 +827,8 @@ public class VaadinPortlet extends GenericPortlet implements Constants {
         newApplication.setLocale(locale);
         // No application URL when running inside a portlet
         newApplication.start(new ApplicationStartEvent(null, getVaadinService()
-                .getApplicationConfiguration(),
-                new PortletCommunicationManager(newApplication)));
+                .getDeploymentConfiguration(), new PortletCommunicationManager(
+                newApplication)));
         addonContext.fireApplicationStarted(newApplication);
 
         return newApplication;
index 41c864fcd983dbfd03e088745258c5de5cda9685..1e9a2667c3abea358841db4378eab44431f226a0 100644 (file)
@@ -106,11 +106,11 @@ public interface VaadinService extends Serializable {
     public String getMimeType(String resourceName);
 
     /**
-     * Gets the application configuration.
+     * Gets the deployment configuration.
      * 
-     * @return the application configuration
+     * @return the deployment configuration
      */
-    public ApplicationConfiguration getApplicationConfiguration();
+    public DeploymentConfiguration getDeploymentConfiguration();
 
     public Iterator<AddonContextListener> getAddonContextListeners();
 
index ce436205d82ff4ccbcd040be3fbfb3fa47687eee..ff58c8da990e7b8321fe3bb89c03335efaca3d58 100644 (file)
@@ -44,7 +44,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 
-import com.vaadin.DefaultApplicationConfiguration;
+import com.vaadin.DefaultDeploymentConfiguration;
 import com.vaadin.server.AbstractCommunicationManager.Callback;
 import com.vaadin.server.ServletPortletHelper.ApplicationClassException;
 import com.vaadin.server.VaadinSession.ApplicationStartEvent;
@@ -59,8 +59,8 @@ public class VaadinServlet extends HttpServlet implements Constants {
         private final VaadinServlet servlet;
 
         public ServletService(VaadinServlet servlet,
-                ApplicationConfiguration applicationProperties) {
-            super(applicationProperties);
+                DeploymentConfiguration deploymentConfiguration) {
+            super(deploymentConfiguration);
             this.servlet = servlet;
         }
 
@@ -74,7 +74,7 @@ public class VaadinServlet extends HttpServlet implements Constants {
                     .cast(request);
             String staticFileLocation;
             // if property is defined in configurations, use that
-            staticFileLocation = getApplicationConfiguration()
+            staticFileLocation = getDeploymentConfiguration()
                     .getApplicationOrSystemProperty(PARAMETER_VAADIN_RESOURCES,
                             null);
             if (staticFileLocation != null) {
@@ -112,10 +112,9 @@ public class VaadinServlet extends HttpServlet implements Constants {
 
         @Override
         public String getConfiguredWidgetset(WrappedRequest request) {
-            return getApplicationConfiguration()
-                    .getApplicationOrSystemProperty(
-                            VaadinServlet.PARAMETER_WIDGETSET,
-                            VaadinServlet.DEFAULT_WIDGETSET);
+            return getDeploymentConfiguration().getApplicationOrSystemProperty(
+                    VaadinServlet.PARAMETER_WIDGETSET,
+                    VaadinServlet.DEFAULT_WIDGETSET);
         }
 
         @Override
@@ -193,41 +192,39 @@ public class VaadinServlet extends HttpServlet implements Constants {
     public void init(javax.servlet.ServletConfig servletConfig)
             throws javax.servlet.ServletException {
         super.init(servletConfig);
-        Properties applicationProperties = new Properties();
+        Properties initParameters = new Properties();
 
         // Read default parameters from server.xml
         final ServletContext context = servletConfig.getServletContext();
         for (final Enumeration<String> e = context.getInitParameterNames(); e
                 .hasMoreElements();) {
             final String name = e.nextElement();
-            applicationProperties.setProperty(name,
-                    context.getInitParameter(name));
+            initParameters.setProperty(name, context.getInitParameter(name));
         }
 
         // Override with application config from web.xml
         for (final Enumeration<String> e = servletConfig
                 .getInitParameterNames(); e.hasMoreElements();) {
             final String name = e.nextElement();
-            applicationProperties.setProperty(name,
+            initParameters.setProperty(name,
                     servletConfig.getInitParameter(name));
         }
 
-        ApplicationConfiguration applicationConfiguration = createApplicationConfiguration(applicationProperties);
-        servletService = createServletService(applicationConfiguration);
+        DeploymentConfiguration deploymentConfiguration = createDeploymentConfiguration(initParameters);
+        servletService = createServletService(deploymentConfiguration);
 
         addonContext = new AddonContext(servletService);
         addonContext.init();
     }
 
-    protected ApplicationConfiguration createApplicationConfiguration(
-            Properties applicationProperties) {
-        return new DefaultApplicationConfiguration(getClass(),
-                applicationProperties);
+    protected DeploymentConfiguration createDeploymentConfiguration(
+            Properties initParameters) {
+        return new DefaultDeploymentConfiguration(getClass(), initParameters);
     }
 
     protected ServletService createServletService(
-            ApplicationConfiguration applicationConfiguration) {
-        return new ServletService(this, applicationConfiguration);
+            DeploymentConfiguration deploymentConfiguration) {
+        return new ServletService(this, deploymentConfiguration);
     }
 
     @Override
@@ -642,7 +639,7 @@ public class VaadinServlet extends HttpServlet implements Constants {
         Locale locale = request.getLocale();
         newApplication.setLocale(locale);
         newApplication.start(new ApplicationStartEvent(applicationUrl,
-                getVaadinService().getApplicationConfiguration(),
+                getVaadinService().getDeploymentConfiguration(),
                 createCommunicationManager(newApplication)));
 
         addonContext.fireApplicationStarted(newApplication);
@@ -1008,7 +1005,7 @@ public class VaadinServlet extends HttpServlet implements Constants {
              * parameter in web.xml
              */
             int resourceCacheTime = getVaadinService()
-                    .getApplicationConfiguration().getResourceCacheTime();
+                    .getDeploymentConfiguration().getResourceCacheTime();
             response.setHeader("Cache-Control",
                     "max-age= " + String.valueOf(resourceCacheTime));
         }
index c4b0680c47240dd0fcde1da186134b043d16f9bd..52a7cd72ee407ff218162a9ba5fee3367e20e056 100644 (file)
@@ -128,7 +128,7 @@ public class VaadinSession implements Terminal.ErrorListener,
     public static class ApplicationStartEvent implements Serializable {
         private final URL applicationUrl;
 
-        private final ApplicationConfiguration configuration;
+        private final DeploymentConfiguration configuration;
 
         private final AbstractCommunicationManager communicationManager;
 
@@ -141,7 +141,7 @@ public class VaadinSession implements Terminal.ErrorListener,
          *            the communication manager for the application.
          */
         public ApplicationStartEvent(URL applicationUrl,
-                ApplicationConfiguration configuration,
+                DeploymentConfiguration configuration,
                 AbstractCommunicationManager communicationManager) {
             this.applicationUrl = applicationUrl;
             this.configuration = configuration;
@@ -161,11 +161,11 @@ public class VaadinSession implements Terminal.ErrorListener,
         }
 
         /**
-         * Returns the application configuration used by this application.
+         * Returns the deployment configuration used by this session.
          * 
          * @return the deployment configuration.
          */
-        public ApplicationConfiguration getConfiguration() {
+        public DeploymentConfiguration getConfiguration() {
             return configuration;
         }
 
@@ -187,7 +187,7 @@ public class VaadinSession implements Terminal.ErrorListener,
     /**
      * Configuration for the application.
      */
-    private ApplicationConfiguration configuration;
+    private DeploymentConfiguration configuration;
 
     /**
      * The application's URL.
@@ -421,7 +421,7 @@ public class VaadinSession implements Terminal.ErrorListener,
      * 
      * @return the application configuration
      */
-    public ApplicationConfiguration getConfiguration() {
+    public DeploymentConfiguration getConfiguration() {
         return configuration;
     }
 
@@ -1885,7 +1885,7 @@ public class VaadinSession implements Terminal.ErrorListener,
      * 
      * @see #getUidlRequestTimeout()
      * @see #closeInactiveUIs()
-     * @see ApplicationConfiguration#getHeartbeatInterval()
+     * @see DeploymentConfiguration#getHeartbeatInterval()
      * 
      * @since 7.0.0
      * 
@@ -1907,7 +1907,7 @@ public class VaadinSession implements Terminal.ErrorListener,
      * otherwise heartbeat requests are enough to extend UI lifetime
      * indefinitely.
      * 
-     * @see ApplicationConfiguration#isIdleUICleanupEnabled()
+     * @see DeploymentConfiguration#isIdleUICleanupEnabled()
      * @see #getHeartbeatTimeout()
      * @see #closeInactiveUIs()
      * 
index d8d1521a4caec7865809980b0067d73ccb08105f..e949df466d2e10af0e804c9bdd70b9b1af9e1340 100644 (file)
@@ -13,7 +13,7 @@ import javax.servlet.http.HttpServletRequest;
 
 import junit.framework.TestCase;
 
-import com.vaadin.DefaultApplicationConfiguration;
+import com.vaadin.DefaultDeploymentConfiguration;
 import com.vaadin.server.VaadinServlet.ServletService;
 
 public class TestAbstractApplicationServletStaticFilesLocation extends TestCase {
@@ -32,7 +32,7 @@ public class TestAbstractApplicationServletStaticFilesLocation extends TestCase
         Field f = VaadinServlet.class.getDeclaredField("servletService");
         f.setAccessible(true);
         f.set(servlet, new ServletService(servlet,
-                new DefaultApplicationConfiguration(servlet.getClass(),
+                new DefaultDeploymentConfiguration(servlet.getClass(),
                         new Properties())));
 
     }
index acc89895efe359c383f277a5fa55bba73b039d8a..707eb577ccdf95858b0d4c2ad10db26e60d2bfa6 100644 (file)
@@ -8,8 +8,8 @@ import junit.framework.TestCase;
 
 import org.easymock.EasyMock;
 
-import com.vaadin.DefaultApplicationConfiguration;
-import com.vaadin.server.ApplicationConfiguration;
+import com.vaadin.DefaultDeploymentConfiguration;
+import com.vaadin.server.DeploymentConfiguration;
 import com.vaadin.server.DefaultUIProvider;
 import com.vaadin.server.VaadinService;
 import com.vaadin.server.VaadinSession;
@@ -64,10 +64,10 @@ public class CustomUIClassLoader extends TestCase {
         assertEquals(MyUI.class, uiClass);
     }
 
-    private static ApplicationConfiguration createConfigurationMock() {
+    private static DeploymentConfiguration createConfigurationMock() {
         Properties properties = new Properties();
         properties.put(VaadinSession.UI_PARAMETER, MyUI.class.getName());
-        return new DefaultApplicationConfiguration(CustomUIClassLoader.class,
+        return new DefaultDeploymentConfiguration(CustomUIClassLoader.class,
                 properties);
     }
 
@@ -115,7 +115,7 @@ public class CustomUIClassLoader extends TestCase {
     private VaadinSession createStubApplication() {
         return new VaadinSession() {
             @Override
-            public ApplicationConfiguration getConfiguration() {
+            public DeploymentConfiguration getConfiguration() {
                 return createConfigurationMock();
             }
         };
index 230a7b92300886e93f243ee4680b7901048b8c73..b483a9fd9de6f5299ae159a5ddfea892b40aed7d 100644 (file)
@@ -31,7 +31,7 @@ import javax.servlet.http.HttpServletResponse;
 
 import com.vaadin.Application;
 import com.vaadin.server.AbstractUIProvider;
-import com.vaadin.server.ApplicationConfiguration;
+import com.vaadin.server.DeploymentConfiguration;
 import com.vaadin.server.LegacyVaadinServlet;
 import com.vaadin.server.UIProvider;
 import com.vaadin.server.VaadinServletSession;
@@ -270,8 +270,8 @@ public class ApplicationRunnerServlet extends LegacyVaadinServlet {
 
     @Override
     protected ServletService createServletService(
-            ApplicationConfiguration applicationConfiguration) {
-        return new ServletService(this, applicationConfiguration) {
+            DeploymentConfiguration deploymentConfiguration) {
+        return new ServletService(this, deploymentConfiguration) {
             @Override
             public String getStaticFileLocation(WrappedRequest request) {
                 URIS uris = getApplicationRunnerURIs(WrappedHttpServletRequest