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.
@FunctionalInterface public interface OneTimeInitializerPredicate
The presence of the service implementing this interface with
runOnce()
returningtrue
means thatServletContainerInitializer
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, javax.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 theServletContainerInitializer
implementation may need to store additional data between calls which is excessive if theServletContainerInitializer.onStartup(java.util.Set, javax.servlet.ServletContext)
is executed only once.Since:
Author:
Vaadin Ltd
-
-
Method Summary
All Methods Modifier and Type Method Description boolean
runOnce()
Checks whether the
ServletContainerInitializer
s requires reset to the previous state onServletContainerInitializer.onStartup(java.util.Set, javax.servlet.ServletContext)
call.
-
-
-
Method Detail
-
runOnce
boolean runOnce()
Checks whether the
ServletContainerInitializer
s requires reset to the previous state onServletContainerInitializer.onStartup(java.util.Set, javax.servlet.ServletContext)
call.Returns:
true
ifServletContainerInitializer
s are executed only once,false
otherwise
-
-