Interface TailerListener


public interface TailerListener
Based on the Apache TailerListener but uses a Tailer interface instead of a class for improved extensibility.
Author:
Brandon Arp (brandon dot arp at inscopemetrics dot io)
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This method is called if the tailed file is not found.
    void
    Called if a file is successfully opened.
    void
    Called if a file rotation is detected.
    void
    handle(byte[] line)
    Handles a line from a Tailer.
    void
    handle(Throwable throwable)
    Handles a Throwable encountered during tailing.
    void
    The Tailer instance invokes this method during construction giving the listening class a method of stopping the Tailer.
  • Method Details

    • initialize

      void initialize(Tailer tailer)
      The Tailer instance invokes this method during construction giving the listening class a method of stopping the Tailer.
      Parameters:
      tailer - the Tailer instance.
    • fileNotFound

      void fileNotFound()
      This method is called if the tailed file is not found.

      Note: this is called from the Tailer thread.

    • fileRotated

      void fileRotated()
      Called if a file rotation is detected. This method is called before the file is reopened, and fileNotFound may be called if the new file has not been created yet.

      Note: this is called from the Tailer thread.

    • fileOpened

      void fileOpened()
      Called if a file is successfully opened.

      Note: this is called from the Tailer thread.

    • handle

      void handle(byte[] line)
      Handles a line from a Tailer.

      Note: this is called from the Tailer thread.

      Parameters:
      line - the raw line.
    • handle

      void handle(Throwable throwable)
      Handles a Throwable encountered during tailing.

      Note: this is called from the Tailer thread.

      Parameters:
      throwable - the Throwable.