public class DefaultExecHandle extends Object implements ExecHandle
The ExecHandle has very strict state control. The following state flows are allowed:
Normal state flow:start() can only be called when the state is NOT ExecHandleState.STARTEDabort() can only be called when the state is ExecHandleState.STARTED| Modifier and Type | Method and Description |
|---|---|
void |
abort() |
void |
addListener(ExecHandleListener listener) |
List<String> |
getArguments() |
String |
getCommand() |
File |
getDirectory() |
Map<String,String> |
getEnvironment() |
OutputStream |
getErrorOutput() |
InputStream |
getStandardInput() |
OutputStream |
getStandardOutput() |
ExecHandleState |
getState() |
void |
removeListener(ExecHandleListener listener) |
ExecHandle |
start()
Starts this process, blocking until the process has started.
|
String |
toString() |
ExecResult |
waitForFinish() |
public File getDirectory()
getDirectory in interface ExecHandlepublic String getCommand()
getCommand in interface ExecHandlepublic List<String> getArguments()
getArguments in interface ExecHandlepublic Map<String,String> getEnvironment()
getEnvironment in interface ExecHandlepublic OutputStream getStandardOutput()
public OutputStream getErrorOutput()
public InputStream getStandardInput()
public ExecHandleState getState()
getState in interface ExecHandlepublic ExecHandle start()
ExecHandlestart in interface ExecHandlepublic void abort()
abort in interface ExecHandlepublic ExecResult waitForFinish()
waitForFinish in interface ExecHandlepublic void addListener(ExecHandleListener listener)
addListener in interface ExecHandlepublic void removeListener(ExecHandleListener listener)
removeListener in interface ExecHandleCopyright © 2013. All rights reserved