Package org.apache.commons.exec

# Class DaemonExecutor

java.lang.Object
org.apache.commons.exec.DefaultExecutor
org.apache.commons.exec.DaemonExecutor

All Implemented Interfaces:
  `Executor`

public class DaemonExecutor extends DefaultExecutor
Runs daemon processes asynchronously. Callers are expected to register a `ProcessDestroyer` before executing any processes.

Since:
  1.3

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `DaemonExecutor.Builder`
  Constructs a new builder.

- ## Field Summary

  ### Fields inherited from interface org.apache.commons.exec.Executor

  `INVALID_EXITVALUE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DaemonExecutor()`
  Deprecated.
  Use `DaemonExecutor.Builder.get()`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static DaemonExecutor.Builder`
  `builder()`
  Creates a new builder.
  `protected Thread`
  `createThread(Runnable runnable, String name)`
  Factory method to create a thread waiting for the result of an asynchronous execution.

  ### Methods inherited from class org.apache.commons.exec.DefaultExecutor

  `execute, execute, execute, execute, getExecutorThread, getProcessDestroyer, getStreamHandler, getWatchdog, getWorkingDirectory, isFailure, launch, launch, setExitValue, setExitValues, setProcessDestroyer, setStreamHandler, setWatchdog, setWorkingDirectory`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.apache.commons.exec.Executor

  `getWorkingDirectoryPath`

- ## Constructor Details

  - ### DaemonExecutor

    @Deprecated public DaemonExecutor()
    Deprecated.
    Use `DaemonExecutor.Builder.get()`.
    Constructs a new instance.

- ## Method Details

  - ### builder

    public static DaemonExecutor.Builder builder()
    Creates a new builder.
    Returns:
      a new builder.
    Since:
      1.4.0

  - ### createThread

    protected Thread createThread(Runnable runnable, String name)
    Factory method to create a thread waiting for the result of an asynchronous execution.
    Overrides:
      `createThread` in class `DefaultExecutor`
    Parameters:
      `runnable` - the runnable passed to the thread.
      `name` - the name of the thread.
    Returns:
      the thread.