public class ThreadFactoryBuilder
extends java.lang.Object
ThreadFactory
builder.Constructor and Description |
---|
ThreadFactoryBuilder() |
Modifier and Type | Method and Description |
---|---|
static ThreadFactoryBuilder |
create()
Returns new
ThreadFactory builder. |
java.util.concurrent.ThreadFactory |
get()
Returns a new thread factory using the options supplied during the building process.
|
ThreadFactoryBuilder |
setBackingThreadFactory(java.util.concurrent.ThreadFactory backingThreadFactory)
Sets the backing
ThreadFactory for new threads. |
ThreadFactoryBuilder |
setDaemon(boolean daemon)
Sets if new threads will be daemon.
|
ThreadFactoryBuilder |
setNameFormat(java.lang.String nameFormat)
Sets the printf-compatible naming format for threads.
|
ThreadFactoryBuilder |
setPriority(int priority)
Sets the threads priority.
|
ThreadFactoryBuilder |
setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Sets the
UncaughtExceptionHandler for new threads created. |
public static ThreadFactoryBuilder create()
ThreadFactory
builder.public ThreadFactoryBuilder setNameFormat(java.lang.String nameFormat)
%d
to replace it with the thread number.public ThreadFactoryBuilder setDaemon(boolean daemon)
public ThreadFactoryBuilder setPriority(int priority)
public ThreadFactoryBuilder setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
UncaughtExceptionHandler
for new threads created.public ThreadFactoryBuilder setBackingThreadFactory(java.util.concurrent.ThreadFactory backingThreadFactory)
ThreadFactory
for new threads. Threads
will be created by invoking newThread(Runnable
on this backing factory.public java.util.concurrent.ThreadFactory get()
Copyright © 2003-present Jodd Team