Package jodd.util

Class ThreadFactoryBuilder


  • public class ThreadFactoryBuilder
    extends java.lang.Object
    Fluent ThreadFactory builder.
    • Constructor Detail

      • ThreadFactoryBuilder

        public ThreadFactoryBuilder()
    • Method Detail

      • withNameFormat

        public ThreadFactoryBuilder withNameFormat​(java.lang.String nameFormat)
        Sets the printf-compatible naming format for threads. Use %d to 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 the UncaughtExceptionHandler for new threads created.
      • withBackingThreadFactory

        public ThreadFactoryBuilder withBackingThreadFactory​(java.util.concurrent.ThreadFactory backingThreadFactory)
        Sets the backing ThreadFactory for new threads. Threads will be created by invoking newThread(Runnable on 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.