类 ThreadFactoryBuilder
- java.lang.Object
-
- net.dongliu.commons.concurrent.ThreadFactoryBuilder
-
public class ThreadFactoryBuilder extends java.lang.ObjectFor creating custom thread-factory
-
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 java.util.concurrent.ThreadFactorybuild()Build a thread factory.ThreadFactoryBuilderclassLoader(java.lang.ClassLoader classLoader)Set context ClassLoader for thread created.ThreadFactoryBuilderdaemon(boolean daemon)Set the daemon property of created thread.ThreadFactoryBuildername(java.lang.String name)Set the name for this thread factory.ThreadFactoryBuilderpriority(int priority)Set the priority of created thread.ThreadFactoryBuilderthreadNameBuilder(net.dongliu.commons.concurrent.ThreadFactoryBuilder.ThreadNameBuilder threadNameBuilder)Set thread name builder for this thread factory.ThreadFactoryBuilderuncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)Set uncaughtExceptionHandler for the thread this factory created.
-
-
-
方法详细资料
-
daemon
public ThreadFactoryBuilder daemon(boolean daemon)
Set the daemon property of created thread. Default false.- 参数:
daemon- thread daemon- 返回:
- self
-
priority
public ThreadFactoryBuilder priority(int priority)
Set the priority of created thread. DefaultThread.NORM_PRIORITY.- 参数:
priority- thread priority- 返回:
- self
-
name
public ThreadFactoryBuilder name(java.lang.String name)
Set the name for this thread factory.- 参数:
name- the thread factory name- 返回:
- self
-
uncaughtExceptionHandler
public ThreadFactoryBuilder uncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler uncaughtExceptionHandler)
Set uncaughtExceptionHandler for the thread this factory created.- 参数:
uncaughtExceptionHandler- the uncaughtExceptionHandler, not null- 返回:
- self
-
classLoader
public ThreadFactoryBuilder classLoader(java.lang.ClassLoader classLoader)
Set context ClassLoader for thread created.- 参数:
classLoader- the context ClassLoader, not null- 返回:
- self
-
threadNameBuilder
public ThreadFactoryBuilder threadNameBuilder(net.dongliu.commons.concurrent.ThreadFactoryBuilder.ThreadNameBuilder threadNameBuilder)
Set thread name builder for this thread factory.- 参数:
threadNameBuilder- thread name builder- 返回:
- self
-
build
public java.util.concurrent.ThreadFactory build()
Build a thread factory.- 返回:
- the thread factory
-
-