类 ThreadFactoryBuilder


  • public class ThreadFactoryBuilder
    extends java.lang.Object
    For creating custom thread-factory
    • 方法详细资料

      • 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. Default Thread.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