A robust thread is a thread that catches all uncaught exceptions from its runnable target and, by default, restarts the target to avoid fatal crashes. Although the thread terminates if its target run method exits without exceptions, this class is meant for long running or daemon threads. An exception handler interface is provided in order to do exception handling at thread level and/or perform necessary cleanup before either restarting or terminating the thread.
The RobustThread run method is declared final, so a subclass of RobustThread cannot itself be used as a runnable object, as with the Thread base class. Instead, when started, an instance of this class always runs an implementation of the Runnable interface as a target. This is because the run method of the class implements the exception handling and restart functionality.
@author Andres Quiroz Hernandez
@version 6.0