Class DaemonThreadFactory

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

    public final class DaemonThreadFactory
    extends java.lang.Object
    implements java.util.concurrent.ThreadFactory
    This class provides a method that creates new threads on demand to run daemon task
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Thread newThread​(java.lang.Runnable runnable)
      Constructs a new Thread with priority and daemon status
      • Methods inherited from class java.lang.Object

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

      • DaemonThreadFactory

        public DaemonThreadFactory()
    • Method Detail

      • newThread

        public java.lang.Thread newThread​(java.lang.Runnable runnable)
        Constructs a new Thread with priority and daemon status
        Specified by:
        newThread in interface java.util.concurrent.ThreadFactory
        Parameters:
        runnable - a runnable to be executed by new thread instance
        Returns:
        constructed thread