Package com.vaadin.quarkus
Class QuarkusVaadinServletService
java.lang.Object
com.vaadin.flow.server.VaadinService
com.vaadin.flow.server.VaadinServletService
com.vaadin.quarkus.QuarkusVaadinServletService
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
MockQuarkusServletService
An implementation of
VaadinService for Quarkus
environment.
This class looks up for and therefore provides an Instantiator bean.
It also forwards Vaadin events to CDI listeners.- Author:
- Vaadin Ltd
- See Also:
-
Field Summary
Fields inherited from class com.vaadin.flow.server.VaadinService
ATMOSPHERE_MISSING_ERROR, INVALID_ATMOSPHERE_VERSION_WARNING -
Constructor Summary
ConstructorsConstructorDescriptionQuarkusVaadinServletService(QuarkusVaadinServlet servlet, DeploymentConfiguration configuration, jakarta.enterprise.inject.spi.BeanManager beanManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected ExecutorCreates a default executor instance to use with this service.voidFire UI initialization event to all registeredUIInitListeners.Retrieves a reference to the servlet associated with this service.voidinit()Initializes this service.Loads and initializes instantiators.<T> Optional<T> Gets an instance of a@VaadinServiceEnabledannotated bean of the giventype.Methods inherited from class com.vaadin.flow.server.VaadinServletService
constructVaadinContext, createRequestHandlers, getContextRootRelativePath, getCurrentResponse, getCurrentServletRequest, getMainDivId, getMimeType, getPwaRegistry, getResource, getResourceAsStream, getResourceInServletContext, getRouteRegistry, getServiceName, getStaticResource, requestCanCreateSession, resolveResource, setDefaultClassLoaderMethods inherited from class com.vaadin.flow.server.VaadinService
accessSession, addServiceDestroyListener, addSessionDestroyListener, addSessionInitListener, addUIInitListener, closeSession, createCriticalNotificationJSON, createCriticalNotificationJSON, createDefaultObjectMapper, createInstantiator, createSessionExpiredJSON, createUINotFoundJSON, createVaadinRequestInterceptors, createVaadinSession, destroy, ensureAccessQueuePurged, ensurePushAvailable, findUI, findVaadinSession, fireSessionDestroy, getBootstrapInitialPredicate, getBootstrapUrlPredicate, getClassLoader, getContext, getCsrfTokenAttributeName, getCurrent, getCurrentRequest, getDependencyFilters, getDeploymentConfiguration, getExecutor, getExistingSession, getInstantiator, getRequestHandlers, getRouter, getSessionAttributeName, getSessionLock, getSystemMessages, getSystemMessagesProvider, getVaadinRequestInterceptors, 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
-
QuarkusVaadinServletService
public QuarkusVaadinServletService(QuarkusVaadinServlet servlet, DeploymentConfiguration configuration, jakarta.enterprise.inject.spi.BeanManager beanManager)
-
-
Method Details
-
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
-
fireUIInitListeners
Description copied from class:VaadinServiceFire UI initialization event to all registeredUIInitListeners.- Overrides:
fireUIInitListenersin classVaadinService- Parameters:
ui- the initializedUI
-
createDefaultExecutor
Description copied from class:VaadinServiceCreates a default executor instance to use with this service. This default implementation creates a virtual tread executor.A custom
VaadinServiceimplementation can override this method to provide its own ad-hoc executor tailored to specific environments like CDI or Spring.Implementors should never return null; if an executor instance cannot be provided, the method should call
super.createDefaultExecutor().The application can provide a more appropriate executor implementation through a
VaadinServiceInitListenerand callingServiceInitEvent.setExecutor(Executor).- Overrides:
createDefaultExecutorin classVaadinService- Returns:
- a default executor instance to use, never null.
- See Also:
-
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:
-
getServlet
Description copied from class:VaadinServletServiceRetrieves a reference to the servlet associated with this service. Should be overridden (or otherwise intercepted) if the no-arg constructor is used to prevent NPEs.- Overrides:
getServletin classVaadinServletService- Returns:
- A reference to the VaadinServlet this service is using
-
lookup
Gets an instance of a@VaadinServiceEnabledannotated bean of the giventype.- Type Parameters:
T- the type of the service- Parameters:
type- the required service type- Returns:
- an
Optionalwrapping the service instance, orOptional.empty()if no bean definition exists for given type. - Throws:
ServiceException- if multiple beans exists for the given type.
-