Class NamedThreadFactory

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

    public class NamedThreadFactory
    extends java.lang.Object
    implements java.util.concurrent.ThreadFactory
    Custom thread factory which sets the name to make it easier to identify where the pooled threads were created.
    Author:
    Trejkaz, Pierre Frisch
    • Constructor Summary

      Constructors 
      Constructor Description
      NamedThreadFactory​(java.lang.String namePrefix)
      Constructs the thread factory.
    • Method Summary

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

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

      • NamedThreadFactory

        public NamedThreadFactory​(java.lang.String namePrefix)
        Constructs the thread factory.
        Parameters:
        namePrefix - a prefix to append to thread names (will be separated from the default thread name by a space.)
    • Method Detail

      • newThread

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