com.vaadin.flow.hotswap.

Interface VaadinHotswapper

All Known Implementing Classes:

Hotswapper, ReflectionCacheHotswapper, RouteRegistryHotswapper

public interface VaadinHotswapper

Implementor ot this interface are responsible for update Vaadin components when application classes change.

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 Type
    Method
    Description
    default boolean
    onClassLoadEvent(VaadinService vaadinService, Set<Class<?>> classes, boolean redefined)

    Called by Vaadin hotswap entry point when one or more application classes have been updated.

    default boolean
    onClassLoadEvent(VaadinSession vaadinSession, Set<Class<?>> classes, boolean redefined)

    Called by Vaadin hotswap entry point when one or more application classes have been updated.

    default void

    Called by Vaadin hotswap entry point after all hotswap related operations have been completed.

  • Method Details

    • onClassLoadEvent

      default boolean onClassLoadEvent(VaadinService vaadinService, Set<Class<?>> classes, boolean redefined)

      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 - active VaadinService instance.

      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:

    • onClassLoadEvent

      default boolean onClassLoadEvent(VaadinSession vaadinSession, Set<Class<?>> classes, boolean redefined)

      Called by Vaadin hotswap entry point when one or more application classes have been updated.

      This method is meant to perform updates at VaadinSession level. Operation targeting the entire application should be implemented in onClassLoadEvent(VaadinService, Set, boolean) method.

      Parameters:

      vaadinSession - the VaadinSession to 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:

    • onHotswapComplete

      default void onHotswapComplete(HotswapCompleteEvent event)

      Called by Vaadin hotswap entry point after all hotswap related operations have been completed.

      Parameters:

      event - an event containing information about the hotswap operation.