Package com.vaadin.flow.server.startup
Class LookupServletContainerInitializer
java.lang.Object
com.vaadin.flow.server.startup.LookupServletContainerInitializer
- All Implemented Interfaces:
ClassLoaderAwareServletContainerInitializer,jakarta.servlet.ServletContainerInitializer
public class LookupServletContainerInitializer
extends Object
implements ClassLoaderAwareServletContainerInitializer
Standard servlet initializer for collecting all SPI implementations.
For internal use only. May be renamed or removed in a future release.
- Author:
- Vaadin Ltd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<Class<?>> Gets the service types that are used to set services into theLookupbased on found subtypes by theServletContainerInitializer.voidImplement this method instead ofClassLoaderAwareServletContainerInitializer.onStartup(Set, ServletContext)to handle classes accessible by different classloaders.booleanWhether this initializer requires lookup or not.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.server.startup.ClassLoaderAwareServletContainerInitializer
onStartup
-
Constructor Details
-
LookupServletContainerInitializer
public LookupServletContainerInitializer()
-
-
Method Details
-
process
public void process(Set<Class<?>> classSet, jakarta.servlet.ServletContext servletContext) throws jakarta.servlet.ServletException Description copied from interface:ClassLoaderAwareServletContainerInitializerImplement this method instead ofClassLoaderAwareServletContainerInitializer.onStartup(Set, ServletContext)to handle classes accessible by different classloaders.- Specified by:
processin interfaceClassLoaderAwareServletContainerInitializer- Parameters:
classSet- the Set of application classes that extend, implement, or have been annotated with the class types specified by theHandlesTypesannotation, ornullif there are no matches, or thisServletContainerInitializerhas not been annotated withHandlesTypesservletContext- theServletContextof the web application that is being started and in which the classes contained inclassSetwere found- Throws:
jakarta.servlet.ServletException- if an error has occurred- See Also:
-
requiresLookup
public boolean requiresLookup()Description copied from interface:ClassLoaderAwareServletContainerInitializerWhether this initializer requires lookup or not.- Specified by:
requiresLookupin interfaceClassLoaderAwareServletContainerInitializer- Returns:
- whether this initializer requires lookup
-
getServiceTypes
Gets the service types that are used to set services into theLookupbased on found subtypes by theServletContainerInitializer.LookupServletContainerInitializerusesServletContainerInitializerclasses discovering mechanism based onHandlesTypesannotation. The method may be overridden to return the service types which should be put into theLookupinstance if another mechanism of class searching is used (e.g. Spring boot case).The set of classes (passed into the
process(Set, ServletContext)method) will be filtered via checking whether they are assignable to the service types and the resulting classes will be instantiated via reflection.- Returns:
- a collection of service types which should be available via Lookup
- See Also:
-