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 TypeMethodDescriptionvoid
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 aTailer
.void
Handles aThrowable
encountered during tailing.void
initialize
(Tailer tailer)
-
Method Details
-
initialize
TheTailer
instance invokes this method during construction giving the listening class a method of stopping theTailer
.- Parameters:
tailer
- theTailer
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) - Parameters:
line
- the raw line.
-
handle
- Parameters:
throwable
- theThrowable
.
-