Class DevLoopHotswapper
- All Implemented Interfaces:
VaadinHotswapper
VaadinHotswapper SPI, so the dev loop can
report what Flow did with a redefine rather than guess.
The daemon needs neither a completion signal nor a classification of its own:
Flow already computes both, and onHotswapComplete is the
authoritative "the runtime leg is done" event that a transaction gates on.
The Priority is deliberately large so this runs after Flow's own
hotswappers (they sort ascending), meaning anything they decided has already
been decided by the time this sees the event.
Flow does not expose the refresh strategy it computed - the public
getUIUpdateStrategy only reports a strategy a hotswapper explicitly
requested - so the strategy is logged for diagnosis but never used as the
apply classification. The daemon reports what it did itself instead.
For internal use only. May be renamed or removed in a future release.
- Since:
- 25.3
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DevLoopHotswapperThe instance receiving hotswap events, ornullbefore Flow's hotswapper has initialized.booleanWhether Flow reported the hotswap complete since the lastreset().booleanWhether Flow decided a page reload is required for the changes seen since the lastreset().voidonClassesChange(HotswapClassEvent event) Called by Vaadin hotswap entry point when one or more application classes have been updated.voidCalled by Vaadin hotswap entry point when one or more application classes have been updated.voidCalled by Vaadin hotswap entry point after all hotswap related operations have been completed.voidonInit(VaadinService vaadinService) Called during the initialization of the VaadinHotswapper.voidreset()Clears recorded state before the next transaction.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.base.devserver.hotswap.VaadinHotswapper
onClassLoadEvent, onClassLoadEvent, onResourcesChange
-
Constructor Details
-
DevLoopHotswapper
public DevLoopHotswapper()Creates the hotswapper. It is found through the service loader.
-
-
Method Details
-
getActive
The instance receiving hotswap events, ornullbefore Flow's hotswapper has initialized.- Returns:
- the active instance, or
null
-
onInit
Description copied from interface:VaadinHotswapperCalled 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.- Specified by:
onInitin interfaceVaadinHotswapper- Parameters:
vaadinService- the activeVaadinServiceinstance being initialized
-
onClassesChange
Description copied from interface:VaadinHotswapperCalled 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
VaadinHotswapper.onClassesChange(HotswapClassSessionEvent)method.Currently, the default implementation delegates to the deprecated
VaadinHotswapper.onClassLoadEvent(VaadinService, Set, boolean)method for backward compatibility.- Specified by:
onClassesChangein interfaceVaadinHotswapper- Parameters:
event- the event instance carrying the information about the changed classes.- See Also:
-
onClassesChange
Description copied from interface:VaadinHotswapperCalled 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 inVaadinHotswapper.onClassesChange(HotswapClassEvent)method.Currently, the default implementation delegates to the deprecated
VaadinHotswapper.onClassLoadEvent(VaadinSession, Set, boolean)method for backward compatibility.- Specified by:
onClassesChangein interfaceVaadinHotswapper- Parameters:
event- the event instance carrying the information about the changed classes.- See Also:
-
onHotswapComplete
Description copied from interface:VaadinHotswapperCalled by Vaadin hotswap entry point after all hotswap related operations have been completed.- Specified by:
onHotswapCompletein interfaceVaadinHotswapper- Parameters:
event- an event containing information about the hotswap operation.
-
reset
public void reset()Clears recorded state before the next transaction. -
isCompleted
public boolean isCompleted()Whether Flow reported the hotswap complete since the lastreset().- Returns:
trueifonHotswapCompletewas called
-
isPageReloadRequired
public boolean isPageReloadRequired()Whether Flow decided a page reload is required for the changes seen since the lastreset().- Returns:
trueif a page reload is required
-