Interface HotSwapFilesModificationsListener


public interface HotSwapFilesModificationsListener
A listener for file(s) that are watched for modifications.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    fileModified(File modifiedFile)
    Called when the watched file(s) are modified.
    The file(s) to watch.
    boolean
    Should this listener be enabled?
  • Method Details

    • isEnabled

      boolean isEnabled()
      Should this listener be enabled?

      You often want to use such file modifications listeners only during development, for autoreload purposes. In production, you would disable it.

      When this method return false, the listener is not registered, at all.

      A common pattern for this method is to use:

       return getSpincastConfig().isDevelopmentMode();
       
    • getFilesToWatch

      Set<FileToWatch> getFilesToWatch()
      The file(s) to watch.
    • fileModified

      void fileModified(File modifiedFile)
      Called when the watched file(s) are modified.

      Receives the file that was modified.

      The method is called in a new Thread.