Package jodd.util
Class ThreadFactoryBuilder
- java.lang.Object
-
- jodd.util.ThreadFactoryBuilder
-
public class ThreadFactoryBuilder extends java.lang.ObjectFluentThreadFactorybuilder.
-
-
Constructor Summary
Constructors Constructor Description ThreadFactoryBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ThreadFactoryBuildercreate()Returns newThreadFactorybuilder.java.util.concurrent.ThreadFactoryget()Returns a new thread factory using the options supplied during the building process.ThreadFactoryBuilderwithBackingThreadFactory(java.util.concurrent.ThreadFactory backingThreadFactory)Sets the backingThreadFactoryfor new threads.ThreadFactoryBuilderwithDaemon(boolean daemon)Sets if new threads will be daemon.ThreadFactoryBuilderwithNameFormat(java.lang.String nameFormat)Sets the printf-compatible naming format for threads.ThreadFactoryBuilderwithPriority(int priority)Sets the threads priority.ThreadFactoryBuilderwithUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)Sets theUncaughtExceptionHandlerfor new threads created.
-
-
-
Method Detail
-
create
public static ThreadFactoryBuilder create()
Returns newThreadFactorybuilder.
-
withNameFormat
public ThreadFactoryBuilder withNameFormat(java.lang.String nameFormat)
Sets the printf-compatible naming format for threads. Use%dto replace it with the thread number.
-
withDaemon
public ThreadFactoryBuilder withDaemon(boolean daemon)
Sets if new threads will be daemon.
-
withPriority
public ThreadFactoryBuilder withPriority(int priority)
Sets the threads priority.
-
withUncaughtExceptionHandler
public ThreadFactoryBuilder withUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Sets theUncaughtExceptionHandlerfor new threads created.
-
withBackingThreadFactory
public ThreadFactoryBuilder withBackingThreadFactory(java.util.concurrent.ThreadFactory backingThreadFactory)
Sets the backingThreadFactoryfor new threads. Threads will be created by invokingnewThread(Runnableon this backing factory.
-
get
public java.util.concurrent.ThreadFactory get()
Returns a new thread factory using the options supplied during the building process. After building, it is still possible to change the options used to build the ThreadFactory and/or build again.
-
-