Class CompilationStatusChecker

java.lang.Object
com.vaadin.copilot.CompilationStatusChecker
All Implemented Interfaces:
Consumer<IDEHeartbeatResponse>

public class CompilationStatusChecker extends Object implements Consumer<IDEHeartbeatResponse>
A consumer that listens to IDE heartbeat responses to detect and react to changes in compilation status.

If the compilation status changes (i.e., from no errors to errors or vice versa), it sends a message to the developer tools interface indicating the new status and optionally includes the list of files with compilation errors.

  • Constructor Details

    • CompilationStatusChecker

      public CompilationStatusChecker()
  • Method Details

    • subscribe

      public void subscribe(com.vaadin.base.devserver.DevToolsInterface devToolsInterface)
      Subscribes this checker to the IDE heartbeat scheduler to start receiving compilation status updates if not subscribed. Also, updates DevToolsInterface reference so it stays up-to-date This method is synchronized to ensure thread safety.
      Parameters:
      devToolsInterface - the interface to use for sending updates
    • accept

      public void accept(IDEHeartbeatResponse ideHeartbeatResponse)
      Accepts an IDEHeartbeatResponse and checks for changes in compilation error status. If a change is detected, sends a notification with the new status and the list of files with errors (if available).
      Specified by:
      accept in interface Consumer<IDEHeartbeatResponse>
      Parameters:
      ideHeartbeatResponse - the heartbeat response containing compilation status