Class SpringLookupInitializer
- All Implemented Interfaces:
AbstractLookupInitializer
- Direct Known Subclasses:
UITestSpringLookupInitializer
LookupInitializer implementation.- Author:
- Vaadin Ltd
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.di.LookupInitializer
LookupInitializer.AppShellPredicateImpl, LookupInitializer.LookupImpl, LookupInitializer.ResourceProviderImpl -
Field Summary
Fields inherited from class com.vaadin.flow.di.LookupInitializer
ONE_IMPL_REQUIRED, SEVERAL_IMPLS, SPI -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LookupcreateLookup(VaadinContext context, Map<Class<?>, Collection<Class<?>>> services) Creates a lookup based on providedservices.voidinitialize(VaadinContext context, Map<Class<?>, Collection<Class<?>>> services, VaadinApplicationInitializationBootstrap bootstrap) Creates a newLookupinstance, initializes it and passes it to the providedbootstrap.Methods inherited from class com.vaadin.flow.di.LookupInitializer
ensureService, getDefaultImplementations, instantiate
-
Constructor Details
-
SpringLookupInitializer
public SpringLookupInitializer()
-
-
Method Details
-
initialize
public void initialize(VaadinContext context, Map<Class<?>, Collection<Class<?>>> services, VaadinApplicationInitializationBootstrap bootstrap) throws jakarta.servlet.ServletExceptionDescription copied from interface:AbstractLookupInitializerCreates a newLookupinstance, initializes it and passes it to the providedbootstrap.The method should creates a new initialized
Lookupinstance. In some cases it's not possible to create the instance right away when the method is called. To be able to support this usecase the method contract doesn't require to return theLookupinstance. Instead the created instance should be passed to the providedbootstrapconsumer once the instance is created and completely initialized. Thebootstrapwill start the application initialization which otherwise is postponed until aLookupbecomes available.The implementation must use the provided
bootstrapto pass theLookupinstance otherwise the web application based on thisLookupInitializerwill never be bootstrapped.The provided
servicesmap contains service implementations found in application classpath using@HandlesTypesannotation declared forLookupServletContainerInitializer.- Specified by:
initializein interfaceAbstractLookupInitializer- Overrides:
initializein classLookupInitializer- Parameters:
context- a Vaadin context to run initialization forservices- the map of internal services with their implementations found in the application classpathbootstrap- the web application bootstrap- Throws:
jakarta.servlet.ServletException- if initialization failed
-
createLookup
Description copied from class:LookupInitializerCreates a lookup based on providedservices.- Overrides:
createLookupin classLookupInitializer- Parameters:
context- a Vaadin context to create a lookup forservices- the service objects mapped to the service type to create a lookup- Returns:
- the lookup instance created with provided services
-