Class NamedThreadFactory

  • All Implemented Interfaces:
    java.util.concurrent.ThreadFactory

    public class NamedThreadFactory
    extends java.lang.Object
    implements java.util.concurrent.ThreadFactory
    A thread factory that sets the threads to create threads with a specific prefix name.
    • Constructor Summary

      Constructors 
      Constructor Description
      NamedThreadFactory()
      This constructor is used when the thread name is unknown (or do not need to be set at construct time)
      NamedThreadFactory​(java.lang.String threadName)  
      NamedThreadFactory​(java.lang.String threadName, java.lang.Runnable uncaughtExceptionHook)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Thread newThread​(java.lang.Runnable runnable)  
      java.lang.Thread newThreadWithName​(java.lang.Runnable runnable, java.lang.String threadName)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NamedThreadFactory

        public NamedThreadFactory()
        This constructor is used when the thread name is unknown (or do not need to be set at construct time)
      • NamedThreadFactory

        public NamedThreadFactory​(java.lang.String threadName)
      • NamedThreadFactory

        public NamedThreadFactory​(java.lang.String threadName,
                                  java.lang.Runnable uncaughtExceptionHook)
    • Method Detail

      • newThreadWithName

        public java.lang.Thread newThreadWithName​(java.lang.Runnable runnable,
                                                  java.lang.String threadName)
      • newThread

        public java.lang.Thread newThread​(java.lang.Runnable runnable)
        Specified by:
        newThread in interface java.util.concurrent.ThreadFactory