public class VaadinServletService extends VaadinService
URL_PARAMETER_CLOSE_APPLICATION, URL_PARAMETER_RESTART_APPLICATION| Constructor and Description |
|---|
VaadinServletService(VaadinServlet servlet,
DeploymentConfiguration deploymentConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
protected List<RequestHandler> |
createRequestHandlers()
Called during initialization to add the request handlers for the service.
|
protected URL |
getApplicationUrl(VaadinRequest request)
Get the base URL that should be used for sending requests back to this
service.
|
File |
getBaseDirectory()
Returns the context base directory.
|
static String |
getCancelingRelativePath(String pathToCancel)
Gets a relative path that cancels the provided path.
|
String |
getConfiguredTheme(VaadinRequest request)
Gets the theme that is configured for this deployment, e.g.
|
String |
getConfiguredWidgetset(VaadinRequest request)
Gets the widgetset that is configured for this deployment, e.g.
|
static VaadinServletResponse |
getCurrentResponse() |
static javax.servlet.http.HttpServletRequest |
getCurrentServletRequest() |
String |
getMainDivId(VaadinSession session,
VaadinRequest request,
Class<? extends UI> uiClass)
Creates and returns a unique ID for the DIV where the UI is to be
rendered.
|
String |
getMimeType(String resourceName)
Returns the MIME type of the specified file, or null if the MIME type is
not known.
|
String |
getServiceName()
Gets a unique name for this service.
|
VaadinServlet |
getServlet()
Retrieves a reference to the servlet associated with this service.
|
String |
getStaticFileLocation(VaadinRequest request)
Return the URL from where static files, e.g.
|
InputStream |
getThemeResourceAsStream(UI uI,
String themeName,
String resource)
Finds the given theme resource from the web content folder or using the
class loader and returns a stream for it
|
boolean |
isStandalone(VaadinRequest request)
Checks whether the UI will be rendered on its own in the browser or
whether it will be included into some other context.
|
protected boolean |
requestCanCreateSession(VaadinRequest request)
Checks whether it's valid to create a new service session as a result of
the given request.
|
accessSession, addServiceDestroyListener, addSessionDestroyListener, addSessionInitListener, closeSession, createCriticalNotificationJSON, createVaadinSession, criticalNotification, destroy, ensureAccessQueuePurged, ensurePushAvailable, findUI, findVaadinSession, fireSessionDestroy, getClassLoader, getCurrent, getCurrentRequest, getDeploymentConfiguration, getExistingSession, getRequestHandlers, getSessionAttributeName, getSessionLock, getSystemMessages, getSystemMessagesProvider, handleRequest, handleSessionExpired, init, isAtmosphereAvailable, isCsrfTokenValid, isOtherSessionLocked, loadSession, lockSession, preserveUIOnRefresh, readFromHttpSession, reinitializeSession, removeFromHttpSession, removeServiceDestroyListener, removeSession, removeSessionDestroyListener, removeSessionInitListener, requestEnd, requestStart, runPendingAccessTasks, setClassLoader, setCurrent, setCurrentInstances, setDefaultClassLoader, setSystemMessagesProvider, storeSession, unlockSession, verifyNoOtherSessionLocked, writeStringResponse, writeToHttpSessionpublic VaadinServletService(VaadinServlet servlet, DeploymentConfiguration deploymentConfiguration) throws ServiceException
ServiceExceptionprotected List<RequestHandler> createRequestHandlers() throws ServiceException
VaadinServicecreateRequestHandlers in class VaadinServiceServiceException - if a problem occurs when creating the request handlerspublic VaadinServlet getServlet()
public String getStaticFileLocation(VaadinRequest request)
VaadinServicegetStaticFileLocation in class VaadinServicerequest - the request for which the location should be determinedpublic static String getCancelingRelativePath(String pathToCancel)
pathToCancel - the path that should be canceledpublic String getConfiguredWidgetset(VaadinRequest request)
VaadinServicegetConfiguredWidgetset in class VaadinServicerequest - the request for which a widgetset is requiredpublic String getConfiguredTheme(VaadinRequest request)
VaadinServicegetConfiguredTheme in class VaadinServicerequest - the request for which a theme is requiredpublic boolean isStandalone(VaadinRequest request)
VaadinServiceisStandalone in class VaadinServicerequest - the request for which the UI is loadedpublic String getMimeType(String resourceName)
VaadinServicegetMimeType in class VaadinServiceresourceName - a String specifying the name of a fileServletContext.getMimeType(String),
PortletContext.getMimeType(String)public File getBaseDirectory()
VaadinServicegetBaseDirectory in class VaadinServiceprotected boolean requestCanCreateSession(VaadinRequest request)
VaadinServicerequestCanCreateSession in class VaadinServicerequest - the requesttrue if it's valid to create a new service session
for the request; else falseprotected URL getApplicationUrl(VaadinRequest request) throws MalformedURLException
VaadinServiceThis is only used to support legacy cases.
getApplicationUrl in class VaadinServiceMalformedURLExceptionpublic static javax.servlet.http.HttpServletRequest getCurrentServletRequest()
public static VaadinServletResponse getCurrentResponse()
public String getServiceName()
VaadinServicegetServiceName in class VaadinServicepublic InputStream getThemeResourceAsStream(UI uI, String themeName, String resource) throws IOException
VaadinServicegetThemeResourceAsStream in class VaadinServiceuI - The ui for which to find the resourcethemeName - The name of the themeresource - The name of the resource, e.g. "layouts/mycustomlayout.html"IOException - if a problem occurred while finding or opening the resourcepublic String getMainDivId(VaadinSession session, VaadinRequest request, Class<? extends UI> uiClass)
VaadinServicegetMainDivId in class VaadinServicesession - The service session to which the bootstrapped UI will belong.request - The request for which a div id is neededuiClass - The class of the UI that will be bootstrappedCopyright © 2017 Vaadin Ltd. All rights reserved.