Package adams.core.logging
Class FileHandler.DelayedPublishRunnable
- java.lang.Object
-
- adams.core.logging.FileHandler.DelayedPublishRunnable
-
- All Implemented Interfaces:
Stoppable,StoppableWithFeedback,Runnable
- Enclosing class:
- FileHandler
public static class FileHandler.DelayedPublishRunnable extends Object implements Runnable, StoppableWithFeedback
Runnable for doing the actual writing.
-
-
Constructor Summary
Constructors Constructor Description DelayedPublishRunnable(File logFile)Initializes the runnable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoPublish(LogRecord record)Writes the record to disk.booleanisStopped()Whether the execution has been stopped.voidpublish(LogRecord record)Adds the record to write to disk.voidrun()When an object implementing interfaceRunnableis used to create a thread, starting the thread causes the object'srunmethod to be called in that separately executing thread.voidstopExecution()Stops the execution.
-
-
-
Field Detail
-
m_LogFile
protected File m_LogFile
the file to write to.
-
m_Stopped
protected boolean m_Stopped
whether the writing has been stopped.
-
m_Queue
protected BlockingQueue<LogRecord> m_Queue
the queue of log records to output.
-
-
Constructor Detail
-
DelayedPublishRunnable
public DelayedPublishRunnable(File logFile)
Initializes the runnable.- Parameters:
logFile- the file to write to
-
-
Method Detail
-
doPublish
protected void doPublish(LogRecord record)
Writes the record to disk.- Parameters:
record- the record to write
-
run
public void run()
When an object implementing interfaceRunnableis used to create a thread, starting the thread causes the object'srunmethod to be called in that separately executing thread.The general contract of the method
runis that it may take any action whatsoever.- Specified by:
runin interfaceRunnable- See Also:
Thread.run()
-
publish
public void publish(LogRecord record)
Adds the record to write to disk.- Parameters:
record- the record to write out
-
stopExecution
public void stopExecution()
Stops the execution.- Specified by:
stopExecutionin interfaceStoppable
-
isStopped
public boolean isStopped()
Whether the execution has been stopped.- Specified by:
isStoppedin interfaceStoppableWithFeedback- Returns:
- true if stopped
-
-