Class DaemonThreadFactory

  • All Implemented Interfaces:
    java.util.concurrent.ThreadFactory
    Direct Known Subclasses:
    RandomAccessDaemonThreadFactory

    public class DaemonThreadFactory
    extends java.lang.Object
    implements java.util.concurrent.ThreadFactory
    A thread factory that sets the threads to run as daemons. (Otherwise things that embed the threadpool can't shut themselves down).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.concurrent.atomic.AtomicInteger threadNumber  
    • Constructor Summary

      Constructors 
      Constructor Description
      DaemonThreadFactory​(java.lang.String threadNamePrefix)  
    • Method Summary

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

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

      • threadNumber

        protected final java.util.concurrent.atomic.AtomicInteger threadNumber
    • Constructor Detail

      • DaemonThreadFactory

        public DaemonThreadFactory​(java.lang.String threadNamePrefix)
    • Method Detail

      • newThread

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