Package com.vaadin.flow.spring
Class SpringVaadinServletService
java.lang.Object
com.vaadin.flow.server.VaadinService
com.vaadin.flow.server.VaadinServletService
com.vaadin.flow.spring.SpringVaadinServletService
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
MockSpringServletService
Spring application context aware Vaadin servlet service implementation.
- Author:
- Vaadin Ltd
- See Also:
-
Field Summary
Fields inherited from class com.vaadin.flow.server.VaadinService
ATMOSPHERE_MISSING_ERROR, CANNOT_ACQUIRE_CLASSLOADER_SEVERE, INVALID_ATMOSPHERE_VERSION_WARNING -
Constructor Summary
ConstructorsConstructorDescriptionSpringVaadinServletService(VaadinServlet servlet, DeploymentConfiguration deploymentConfiguration, org.springframework.context.ApplicationContext context) Creates an instance connected to the given servlet and using the given configuration with provided applicationcontext. -
Method Summary
Modifier and TypeMethodDescriptionprotected VaadinSessioncreateVaadinSession(VaadinRequest request) Creates a new Vaadin session for this service and request.getStaticResource(String path) Returns a URL to the static resource at the given URI or null if no file found.voidinit()Initializes this service.protected Optional<Instantiator>Loads and initializes instantiators.Methods inherited from class com.vaadin.flow.server.VaadinServletService
constructVaadinContext, createRequestHandlers, getContextRootRelativePath, getCurrentResponse, getCurrentServletRequest, getMainDivId, getMimeType, getPwaRegistry, getResource, getResourceAsStream, getResourceInServletContext, getRouteRegistry, getServiceName, getServlet, requestCanCreateSession, resolveResource, setDefaultClassLoaderMethods inherited from class com.vaadin.flow.server.VaadinService
accessSession, addServiceDestroyListener, addSessionDestroyListener, addSessionInitListener, addUIInitListener, closeSession, createCriticalNotificationJSON, createCriticalNotificationJSON, createInstantiator, createSessionExpiredJSON, createUINotFoundJSON, destroy, ensureAccessQueuePurged, ensurePushAvailable, findUI, findVaadinSession, fireSessionDestroy, fireUIInitListeners, getBootstrapInitialPredicate, getBootstrapUrlPredicate, getClassLoader, getContext, getCsrfTokenAttributeName, getCurrent, getCurrentRequest, getDependencyFilters, getDeploymentConfiguration, getExistingSession, getInstantiator, getRequestHandlers, getRouter, getSessionAttributeName, getSessionLock, getSystemMessages, getSystemMessagesProvider, handleRequest, handleSessionExpired, isAtmosphereAvailable, isCsrfTokenValid, isOtherSessionLocked, isResourceAvailable, isUIActive, loadSession, lockSession, modifyIndexHtmlResponse, readFromHttpSession, reinitializeSession, removeFromHttpSession, removeSession, requestEnd, requestStart, runPendingAccessTasks, setBootstrapInitialPredicate, setBootstrapUrlPredicate, setClassLoader, setCurrent, setCurrentInstances, setSystemMessagesProvider, storeSession, unlockSession, verifyNoOtherSessionLocked, writeStringResponse, writeToHttpSession, writeUncachedStringResponse
-
Constructor Details
-
SpringVaadinServletService
public SpringVaadinServletService(VaadinServlet servlet, DeploymentConfiguration deploymentConfiguration, org.springframework.context.ApplicationContext context) Creates an instance connected to the given servlet and using the given configuration with provided applicationcontext.- Parameters:
servlet- the servlet which receives requestsdeploymentConfiguration- the configuration to usecontext- the Spring application context
-
-
Method Details
-
loadInstantiators
Description copied from class:VaadinServiceLoads and initializes instantiators.A custom Vaadin service implementation can override this method to pick an instantiator in some other way instead of the default implementation that uses
ServiceLoader.There may be only one applicable instantiator. Otherwise
ServiceExceptionwill be thrown.- Overrides:
loadInstantiatorsin classVaadinService- Returns:
- an optional instantator, or an empty optional if no instantiator found
- Throws:
ServiceException- if there are multiple applicable instantiators- See Also:
-
init
Description copied from class:VaadinServiceInitializes this service. The service should be initialized before it is used.- Overrides:
initin classVaadinService- Throws:
ServiceException- if a problem occurs when creating the service
-
createVaadinSession
Description copied from class:VaadinServiceCreates a new Vaadin session for this service and request.- Overrides:
createVaadinSessionin classVaadinService- Parameters:
request- The request for which to create a VaadinSession- Returns:
- A new VaadinSession
-
getStaticResource
Description copied from class:VaadinServiceReturns a URL to the static resource at the given URI or null if no file found.- Overrides:
getStaticResourcein classVaadinServletService- Parameters:
path- the URL for the resource- Returns:
- the resource located at the named path, or
nullif there is no resource at that path
-