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:
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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