public final class DefaultCommandExec extends Object implements CommandExec
| Modifier and Type | Method and Description |
|---|---|
static CommandExec |
createCommandExec() |
Future<ProcessTask> |
exec(CommandLine commandLine,
PropertyChangeListener... listeners)
Executes the command specified by the command line.
|
void |
setCommandError(CommandOutput error)
Sets that reads the error output of the command.
|
void |
setCommandInput(CommandInput input)
Sets that writes to the standard input of the command.
|
void |
setCommandOutput(CommandOutput output)
Sets that reads the standard output of the command.
|
void |
setDestroyOnTimeout(boolean flag)
Sets to destroy the executed command on timeout.
|
void |
setExitCode(int... codes)
Sets the valid command code(s).
|
void |
setObserver(Observer... observer)
Sets the additional observer(s) for the command task.
|
void |
setThreads(Threads threads)
Sets the threads pool.
|
String |
toString() |
public static CommandExec createCommandExec()
CommandExecFactory.create()public void setThreads(Threads threads)
CommandExecsetThreads in interface CommandExecthreads - the Threads.public void setCommandOutput(CommandOutput output)
CommandExecsetCommandOutput in interface CommandExecoutput - the CommandOutput.public void setCommandError(CommandOutput error)
CommandExecsetCommandError in interface CommandExecpublic void setCommandInput(CommandInput input)
CommandExecsetCommandInput in interface CommandExecinput - the CommandInput.public void setExitCode(int... codes)
CommandExecsetExitCode in interface CommandExeccodes - the valid command code(s).public void setDestroyOnTimeout(boolean flag)
CommandExecsetDestroyOnTimeout in interface CommandExecflag - sets to true to destroy the executed command on
timeout.public void setObserver(Observer... observer)
CommandExecsetObserver in interface CommandExecobserver - the Observer observer(s).public Future<ProcessTask> exec(CommandLine commandLine, PropertyChangeListener... listeners) throws CommandExecException
CommandExecexec in interface CommandExeccommandLine - the DefaultCommandLine.listeners - the PropertyChangeListener listeners that are informed
when the command finishes.Future of ProcessTask.CommandExecException - if there was an error executing the command; if the command
was not found; if the exit code of the command is not valid.Copyright © 2014–2015. All rights reserved.