Class Daemon

java.lang.Object
java.lang.Thread
org.apache.hadoop.util.Daemon
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
Daemon.DaemonFactory

@LimitedPrivate({"HDFS","MapReduce"}) @Unstable public class Daemon extends Thread
A thread that has called Thread.setDaemon(boolean) with true.

The runnable code must either be specified in the runnable parameter or in the overridden work() method.

See SubjectInheritingThread for the Subject inheritance behavior this class adds.

  • Constructor Details

    • Daemon

      public Daemon()
      Construct a daemon thread.
    • Daemon

      public Daemon(Runnable runnable)
      Construct a daemon thread.
      Parameters:
      runnable - runnable.
    • Daemon

      public Daemon(ThreadGroup group, Runnable runnable)
      Construct a daemon thread to be part of a specified thread group.
      Parameters:
      group - thread group.
      runnable - runnable.
  • Method Details

    • start

      public final void start()
      Overrides:
      start in class Thread
    • work

      public void work()
      Override this instead of run()
    • run

      public final void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • getRunnable

      public Runnable getRunnable()