Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.gradle.util.exec
Class DefaultExecHandle

    java.lang.Object
      org.gradle.util.exec.DefaultExecHandle

All Implemented Interfaces:
  ExecHandle

    public class DefaultExecHandle

extends java.lang.Object
implements ExecHandle

Default implementation for the ExecHandle interface.

### State flows

The ExecHandle has very strict state control. The following state flows are allowed:

Normal state flow:

- INIT -> STARTED -> SUCCEEDED

Failure state flows:

- INIT -> FAILED
- INIT -> STARTED -> FAILED

Aborted state flow:

- INIT -> STARTED -> ABORTED

State is controlled on all control methods:

- `start()` can only be called when the state is NOT `ExecHandleState.STARTED`
- `abort()` can only be called when the state is `ExecHandleState.STARTED`
- `startAndWaitForFinish()` can only be called when the state is NOT `ExecHandleState.STARTED`

Method Summary
`void` | `abort()`
`void` | `addListeners(ExecHandleListener... listeners)`
`java.util.List<java.lang.String>` | `getArguments()`
`java.lang.String` | `getCommand()`
`java.io.File` | `getDirectory()`
`java.util.Map<java.lang.String,java.lang.String>` | `getEnvironment()`
`ExecOutputHandle` | `getErrorOutputHandle()`
`int` | `getExitCode()`
`java.lang.Throwable` | `getFailureCause()`
`long` | `getKeepWaitingTimeout()`
`java.util.List<ExecHandleListener>` | `getListeners()`
`ExecOutputHandle` | `getStandardOutputHandle()`
`ExecHandleState` | `getState()`
`void` | `removeListeners(ExecHandleListener... listeners)`
`void` | `start()`
`ExecHandleState` | `startAndWaitForFinish()`
`ExecHandleState` | `waitForFinish()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getDirectory

    public java.io.File getDirectory()

  Specified by:
    `getDirectory` in interface `ExecHandle`

### getCommand

    public java.lang.String getCommand()

  Specified by:
    `getCommand` in interface `ExecHandle`

### getArguments

    public java.util.List<java.lang.String> getArguments()

  Specified by:
    `getArguments` in interface `ExecHandle`

### getEnvironment

    public java.util.Map<java.lang.String,java.lang.String> getEnvironment()

  Specified by:
    `getEnvironment` in interface `ExecHandle`

### getKeepWaitingTimeout

    public long getKeepWaitingTimeout()

### getStandardOutputHandle

    public ExecOutputHandle getStandardOutputHandle()

### getErrorOutputHandle

    public ExecOutputHandle getErrorOutputHandle()

### getState

    public ExecHandleState getState()

  Specified by:
    `getState` in interface `ExecHandle`

### getExitCode

    public int getExitCode()

  Specified by:
    `getExitCode` in interface `ExecHandle`

### getFailureCause

    public java.lang.Throwable getFailureCause()

  Specified by:
    `getFailureCause` in interface `ExecHandle`

### start

    public void start()

  Specified by:
    `start` in interface `ExecHandle`

### abort

    public void abort()

  Specified by:
    `abort` in interface `ExecHandle`

### waitForFinish

    public ExecHandleState waitForFinish()

  Specified by:
    `waitForFinish` in interface `ExecHandle`

### startAndWaitForFinish

    public ExecHandleState startAndWaitForFinish()

  Specified by:
    `startAndWaitForFinish` in interface `ExecHandle`

### addListeners

    public void addListeners(ExecHandleListener... listeners)

  Specified by:
    `addListeners` in interface `ExecHandle`

### removeListeners

    public void removeListeners(ExecHandleListener... listeners)

  Specified by:
    `removeListeners` in interface `ExecHandle`

### getListeners

    public java.util.List<ExecHandleListener> getListeners()

  Specified by:
    `getListeners` in interface `ExecHandle`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD