Package com.vaadin.flow.server.startup
Interface ClassLoaderAwareServletContainerInitializer
- All Superinterfaces:
jakarta.servlet.ServletContainerInitializer
- All Known Subinterfaces:
VaadinServletContextStartupInitializer
- All Known Implementing Classes:
AnnotationValidator
,DevModeStartupListener
,EndpointsValidator
,ErrorNavigationTargetInitializer
,LookupServletContainerInitializer
,RouteRegistryInitializer
,VaadinAppShellInitializer
,WebComponentConfigurationRegistryInitializer
,WebComponentExporterAwareValidator
public interface ClassLoaderAwareServletContainerInitializer
extends jakarta.servlet.ServletContainerInitializer
Allows to load the implementation class by one classloader but accepts
classes in
onStartup(Set, ServletContext)
method loaded by another
classloader.
Workaround for https://github.com/vaadin/flow/issues/7805.
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Overridden to use different classloaders if needed.void
Implement this method instead ofonStartup(Set, ServletContext)
to handle classes accessible by different classloaders.default boolean
Whether this initializer requires lookup or not.
-
Method Details
-
onStartup
default void onStartup(Set<Class<?>> set, jakarta.servlet.ServletContext context) throws jakarta.servlet.ServletException Overridden to use different classloaders if needed.- Specified by:
onStartup
in interfacejakarta.servlet.ServletContainerInitializer
- Throws:
jakarta.servlet.ServletException
-
requiresLookup
default boolean requiresLookup()Whether this initializer requires lookup or not.- Returns:
- whether this initializer requires lookup
-
process
void process(Set<Class<?>> classSet, jakarta.servlet.ServletContext context) throws jakarta.servlet.ServletException Implement this method instead ofonStartup(Set, ServletContext)
to handle classes accessible by different classloaders.- Parameters:
classSet
- the Set of application classes that extend, implement, or have been annotated with the class types specified by theHandlesTypes
annotation, ornull
if there are no matches, or thisServletContainerInitializer
has not been annotated withHandlesTypes
context
- theServletContext
of the web application that is being started and in which the classes contained inclassSet
were found- Throws:
jakarta.servlet.ServletException
- if an error has occurred- See Also:
-