com.vaadin.flow.server.startup.
Class LookupServletContainerInitializer
- java.lang.Object
-
- com.vaadin.flow.server.startup.LookupServletContainerInitializer
-
All Implemented Interfaces:
ClassLoaderAwareServletContainerInitializer
,javax.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
Constructors Constructor Description LookupServletContainerInitializer()
-
Method Summary
All Methods Modifier and Type Method Description protected Collection<Class<?>>
getServiceTypes()
Gets the service types that are used to set services into the
Lookup
based on found subtypes by theServletContainerInitializer
.void
process​(Set<Class<?>> classSet, javax.servlet.ServletContext servletContext)
Implement this method instead of
ClassLoaderAwareServletContainerInitializer.onStartup(Set, ServletContext)
to handle classes accessible by different classloaders.boolean
requiresLookup()
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
-
-
-
-
Method Detail
-
process
public void process​(Set<Class<?>> classSet, javax.servlet.ServletContext servletContext) throws javax.servlet.ServletException
Description copied from interface:
ClassLoaderAwareServletContainerInitializer
Implement this method instead of
ClassLoaderAwareServletContainerInitializer.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 foundThrows:
javax.servlet.ServletException
- if an error has occurredSee Also:
ClassLoaderAwareServletContainerInitializer.onStartup(Set, ServletContext)
-
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
protected Collection<Class<?>> getServiceTypes()
Gets the service types that are used to set services into the
Lookup
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:
LookupInitializer.initialize(VaadinContext, Map, VaadinApplicationInitializationBootstrap)
-
-