Interface VaadinHotswapper
- All Known Implementing Classes:
DefaultTranslationsHotswapper,ErrorViewHotswapper,ReflectionCacheHotswapper,RouteRegistryHotswapper,StyleSheetHotswapper
Listener instances are by default discovered using Flow
Lookup mechanisms. Implementors are usually
discovered and instantiated using ServiceLoader, meaning
that all implementations must have a zero-argument constructor and the fully
qualified name of the implementation class must be listed on a separate line
in a META-INF/services/com.vaadin.flow.hotswap.VaadinHotSwapper file present
in the jar file containing the implementation class. Integrations for
specific runtime environments, such as Spring and CDI, might also provide
other ways of discovering implementors.
For internal use only. May be renamed or removed in a future release.
- Since:
- 24.5
- Author:
- Vaadin Ltd
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonClassesChange(HotswapClassEvent event) Called by Vaadin hotswap entry point when one or more application classes have been updated.default voidCalled by Vaadin hotswap entry point when one or more application classes have been updated.default booleanonClassLoadEvent(VaadinService vaadinService, Set<Class<?>> classes, boolean redefined) Deprecated, for removal: This API element is subject to removal in a future version.default booleanonClassLoadEvent(VaadinSession vaadinSession, Set<Class<?>> classes, boolean redefined) Deprecated, for removal: This API element is subject to removal in a future version.As of 25.0, replaced byonClassesChange(HotswapClassSessionEvent).default voidCalled by Vaadin hotswap entry point after all hotswap related operations have been completed.default voidonInit(VaadinService vaadinService) Called during the initialization of the VaadinHotswapper.default voidCalled by Vaadin hotswap entry point when one or more application resources have been updated.
-
Method Details
-
onInit
Called during the initialization of the VaadinHotswapper. This method provides an entry point for executing logic that needs to occur when the associated VaadinService is initialized and before any hotswap events are triggered.- Parameters:
vaadinService- the activeVaadinServiceinstance being initialized- Since:
- 25.0
-
onClassLoadEvent
@Deprecated(since="25.0", forRemoval=true) default boolean onClassLoadEvent(VaadinService vaadinService, Set<Class<?>> classes, boolean redefined) Deprecated, for removal: This API element is subject to removal in a future version.As of 25.0, replaced byonClassesChange(HotswapClassEvent). Please consider moving your implementation to that method.Called by Vaadin hotswap entry point when one or more application classes have been updated.This method is meant to perform application-wide updates. Operation targeting Vaadin session should be implemented in
onClassLoadEvent(VaadinSession, Set, boolean)method.- Parameters:
vaadinService- activeVaadinServiceinstance.classes- the set of changed classes.redefined- true if the classes have been redefined by hotswap mechanism, false if they have been loaded for the first time by the ClassLoader.- Returns:
- true if a browser page reload is required, false otherwise.
- See Also:
-
onClassesChange
Called by Vaadin hotswap entry point when one or more application classes have been updated.This method is meant to perform application-wide updates. Operation targeting Vaadin session should be implemented in
onClassesChange(HotswapClassSessionEvent)method.Currently, the default implementation delegates to the deprecated
onClassLoadEvent(VaadinService, Set, boolean)method for backward compatibility.- Parameters:
event- the event instance carrying the information about the changed classes.- Since:
- 25.0
- See Also:
-
onClassLoadEvent
@Deprecated(since="25.0", forRemoval=true) default boolean onClassLoadEvent(VaadinSession vaadinSession, Set<Class<?>> classes, boolean redefined) Deprecated, for removal: This API element is subject to removal in a future version.As of 25.0, replaced byonClassesChange(HotswapClassSessionEvent). Please consider moving your implementation to that method.Called by Vaadin hotswap entry point when one or more application classes have been updated.This method is meant to perform updates at
VaadinSessionlevel. Operation targeting the entire application should be implemented inonClassLoadEvent(VaadinService, Set, boolean)method.- Parameters:
vaadinSession- theVaadinSessionto be potentially updated.classes- the set of changed classes.redefined- true if the classes have been redefined by hotswap mechanism, false if they have been loaded for the first time by the ClassLoader.- Returns:
- true if a browser page reload is required, false otherwise.
- See Also:
-
onClassesChange
Called by Vaadin hotswap entry point when one or more application classes have been updated.This method is meant to perform updates at
VaadinSessionlevel. Operation targeting the entire application should be implemented inonClassesChange(HotswapClassEvent)method.Currently, the default implementation delegates to the deprecated
onClassLoadEvent(VaadinSession, Set, boolean)method for backward compatibility.- Parameters:
event- the event instance carrying the information about the changed classes.- Since:
- 25.0
- See Also:
-
onResourcesChange
Called by Vaadin hotswap entry point when one or more application resources have been updated.This method is meant to perform application-wide updates, involving all active UI instances.
- Parameters:
event- the event instance carrying the information about the changed resources.- Since:
- 25.0
-
onHotswapComplete
Called by Vaadin hotswap entry point after all hotswap related operations have been completed.- Parameters:
event- an event containing information about the hotswap operation.
-
onClassesChange(HotswapClassEvent).