Package com.vaadin.flow.di
Interface OneTimeInitializerPredicate
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
The presence of the service implementing this interface with
runOnce()
returning true
means that
ServletContainerInitializer
s are executed only once
and the implementation doesn't have to care about cleaning up data collected
based on previous call.
In some cases (e.g. OSGi) the
ServletContainerInitializer.onStartup(java.util.Set, jakarta.servlet.ServletContext)
method may be called several times for the application (with different
classes provided). In this case the initializer logic should reset the data
passed on the previous call and set the new data. To be able to reset the
data correctly the ServletContainerInitializer
implementation may need to store additional data between calls which is
excessive if the
ServletContainerInitializer.onStartup(java.util.Set, jakarta.servlet.ServletContext)
is executed only once.
- Since:
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptionboolean
runOnce()
Checks whether theServletContainerInitializer
s requires reset to the previous state onServletContainerInitializer.onStartup(java.util.Set, jakarta.servlet.ServletContext)
call.
-
Method Details
-
runOnce
boolean runOnce()Checks whether theServletContainerInitializer
s requires reset to the previous state onServletContainerInitializer.onStartup(java.util.Set, jakarta.servlet.ServletContext)
call.- Returns:
true
ifServletContainerInitializer
s are executed only once,false
otherwise
-