Class ReportingThread

java.lang.Object
java.lang.Thread
se.datadosen.util.ReportingThread
All Implemented Interfaces:
java.lang.Runnable

public class ReportingThread
extends java.lang.Thread
Thread that can report if the execution went fine or if an exception occured
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Thread

    java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.lang.Throwable throwable  

    Fields inherited from class java.lang.Thread

    MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
  • Constructor Summary

    Constructors 
    Constructor Description
    ReportingThread​(java.lang.String name)  
  • Method Summary

    Modifier and Type Method Description
    boolean finishedNormally()  
    java.lang.Throwable getThrowable()  
    boolean isDone()  
    void run()  
    protected void runWithTry()  
    void setDone()  
    protected void setThrowable​(java.lang.Throwable t)  

    Methods inherited from class java.lang.Thread

    activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • throwable

      protected java.lang.Throwable throwable
  • Constructor Details

  • Method Details

    • isDone

      public boolean isDone()
    • setDone

      public void setDone()
    • getThrowable

      public java.lang.Throwable getThrowable()
    • setThrowable

      protected void setThrowable​(java.lang.Throwable t)
    • finishedNormally

      public boolean finishedNormally()
    • run

      public void run()
      Specified by:
      run in interface java.lang.Runnable
      Overrides:
      run in class java.lang.Thread
    • runWithTry

      protected void runWithTry() throws java.lang.Throwable
      Throws:
      java.lang.Throwable