public class CaughtExecutorThreadFactory
extends java.lang.Object
implements java.util.concurrent.ThreadFactory
ThreadFactory| Constructor and Description |
|---|
CaughtExecutorThreadFactory() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Thread |
newThread(java.lang.Runnable runnable)
Sets some thread parameters before return a new thread:
Name
Priority
Uncaught exception handler
These thread parameters will be used if they are not null.
|
void |
setThreadName(java.lang.String threadName)
Sets the thread name to be used in a new thread.
|
void |
setThreadPriority(java.lang.Integer threadPriority)
Sets the thread priority to be used in a new thread.
|
void |
setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Sets the uncaught exception handler to be used in a new thread.
|
public java.lang.Thread newThread(java.lang.Runnable runnable)
newThread in interface java.util.concurrent.ThreadFactorybr.com.armange.commons.thread.CaughtExecutorThreadFactory#setUncaughtExceptionHandler(UncaughtExceptionHandler),
setThreadName(String),
setThreadPriority(Integer),
ThreadFactory.newThread(Runnable)public void setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
uncaughtExceptionHandler - the uncaught exception handler.public void setThreadName(java.lang.String threadName)
threadName - the thread name.public void setThreadPriority(java.lang.Integer threadPriority)
threadPriority - the thread priority