public class LoggingThread extends Thread
In case of a non-caught throwable, log the error and rethrow it.
Only to be used with Runnable interfaces, do not extend directly.
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
LoggingThread(Runnable runnable)
Constructor to initialize new Thread object with a runnable target
and a logger-object.
|
LoggingThread(Runnable runnable,
String name) |
LoggingThread(ThreadGroup threadGroup,
Runnable runnable,
String name) |
Modifier and Type | Method and Description |
---|---|
int |
getThreadId() |
void |
run()
Override of run method, that will catch and log throwables.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public LoggingThread(Runnable runnable)
runnable
- The Runnable object that will be executed in this
thread.public LoggingThread(ThreadGroup threadGroup, Runnable runnable, String name)
public int getThreadId()
public final void run()
Made final to indicate this class should not be used to extend for other Thread-classes (only for use with Runnable interfaces).
run
in interface Runnable
run
in class Thread
Thread.run()
Copyright (c) 2014-2021 All Rights Reserved by the RWS Group for and on behalf of its affiliates and subsidiaries