com.vaadin.server
Interface VaadinService

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
AbstractVaadinService, VaadinPortlet.PortletService, VaadinServlet.ServletService

public interface VaadinService
extends java.io.Serializable

Provide deployment specific settings that are required outside terminal specific code.

Since:
7.0
Author:
Vaadin Ltd.

Method Summary
 AddonContext getAddonContext()
           
 java.util.Iterator<AddonContextListener> getAddonContextListeners()
           
 java.io.File getBaseDirectory()
          Returns application context base directory.
 java.lang.ClassLoader getClassLoader()
          Get the class loader to use for loading classes loaded by name, e.g.
 java.lang.String getConfiguredTheme(WrappedRequest request)
          Gets the theme that is configured for this deployment, e.g.
 java.lang.String getConfiguredWidgetset(WrappedRequest request)
          Gets the widgetset that is configured for this deployment, e.g.
 DeploymentConfiguration getDeploymentConfiguration()
          Gets the deployment configuration.
 java.lang.String getMimeType(java.lang.String resourceName)
          Returns the MIME type of the specified file, or null if the MIME type is not known.
 java.lang.String getStaticFileLocation(WrappedRequest request)
          Return the URL from where static files, e.g.
 SystemMessages getSystemMessages()
          Gets the system messages object
 VaadinSession getVaadinSession(WrappedRequest request)
          Gets the Vaadin session associated with this request.
 boolean isStandalone(WrappedRequest request)
          Checks whether the Vaadin application will be rendered on its own in the browser or whether it will be included into some other context.
 void setAddonContext(AddonContext vaadinContext)
           
 

Method Detail

getStaticFileLocation

java.lang.String getStaticFileLocation(WrappedRequest request)
Return the URL from where static files, e.g. the widgetset and the theme, are served. In a standard configuration the VAADIN folder inside the returned folder is what is used for widgetsets and themes. The returned folder is usually the same as the context path and independent of the application.

Parameters:
request - the request for which the location should be determined
Returns:
The location of static resources (should contain the VAADIN directory). Never ends with a slash (/).

getConfiguredWidgetset

java.lang.String getConfiguredWidgetset(WrappedRequest request)
Gets the widgetset that is configured for this deployment, e.g. from a parameter in web.xml.

Parameters:
request - the request for which a widgetset is required
Returns:
the name of the widgetset

getConfiguredTheme

java.lang.String getConfiguredTheme(WrappedRequest request)
Gets the theme that is configured for this deployment, e.g. from a portal parameter or just some sensible default value.

Parameters:
request - the request for which a theme is required
Returns:
the name of the theme

isStandalone

boolean isStandalone(WrappedRequest request)
Checks whether the Vaadin application will be rendered on its own in the browser or whether it will be included into some other context. A standalone application may do things that might interfere with other parts of a page, e.g. changing the page title and requesting focus upon loading.

Parameters:
request - the request for which the application is loaded
Returns:
a boolean indicating whether the application should be standalone

getClassLoader

java.lang.ClassLoader getClassLoader()
Get the class loader to use for loading classes loaded by name, e.g. custom UI classes. null indicates that the default class loader should be used.

Returns:
the class loader to use, or null

getMimeType

java.lang.String getMimeType(java.lang.String resourceName)
Returns the MIME type of the specified file, or null if the MIME type is not known. The MIME type is determined by the configuration of the container, and may be specified in a deployment descriptor. Common MIME types are "text/html" and "image/gif".

Parameters:
resourceName - a String specifying the name of a file
Returns:
a String specifying the file's MIME type
See Also:
ServletContext.getMimeType(String), PortletContext.getMimeType(String)

getDeploymentConfiguration

DeploymentConfiguration getDeploymentConfiguration()
Gets the deployment configuration.

Returns:
the deployment configuration

getAddonContextListeners

java.util.Iterator<AddonContextListener> getAddonContextListeners()

getAddonContext

AddonContext getAddonContext()

setAddonContext

void setAddonContext(AddonContext vaadinContext)

getSystemMessages

SystemMessages getSystemMessages()
Gets the system messages object

Returns:
the system messages object

getBaseDirectory

java.io.File getBaseDirectory()
Returns application context base directory. Typically an application is deployed in a such way that is has an application directory. For web applications this directory is the root directory of the web applications. In some cases applications might not have an application directory (for example web applications running inside a war).

Returns:
The application base directory or null if the application has no base directory.

getVaadinSession

VaadinSession getVaadinSession(WrappedRequest request)
Gets the Vaadin session associated with this request.

Parameters:
request - the request to get a vaadin session for.
Returns:
the vaadin session for the request, or null if no session is found and this is a request for which a new session shouldn't be created.
See Also:
VaadinSession


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