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.
- Since:
- Author:
- Vaadin Ltd
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<Class<?>>
Gets the service types that are used to set services into theLookup
based on found subtypes by theServletContainerInitializer
.void
Implement this method instead ofClassLoaderAwareServletContainerInitializer.onStartup(Set, ServletContext)
to handle classes accessible by different classloaders.boolean
Whether this initializer requires lookup or not.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:ClassLoaderAwareServletContainerInitializer
Implement this method instead ofClassLoaderAwareServletContainerInitializer.onStartup(Set, ServletContext)
to handle classes accessible by different classloaders.- Specified by:
process
in interfaceClassLoaderAwareServletContainerInitializer
- 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
servletContext
- 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:
-
requiresLookup
public boolean requiresLookup()Description copied from interface:ClassLoaderAwareServletContainerInitializer
Whether this initializer requires lookup or not.- Specified by:
requiresLookup
in interfaceClassLoaderAwareServletContainerInitializer
- Returns:
- whether this initializer requires lookup
-
getServiceTypes
Gets the service types that are used to set services into theLookup
based on found subtypes by theServletContainerInitializer
.LookupServletContainerInitializer
usesServletContainerInitializer
classes discovering mechanism based onHandlesTypes
annotation. The method may be overridden to return the service types which should be put into theLookup
instance 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:
-