public class BasicCommandTaskExecutor extends Object implements TaskExecutor
CommandTaskInfo
via fork/exec.Modifier and Type | Field and Description |
---|---|
static boolean |
WINDOWS
Whether the running System is Windows or not.
|
Constructor and Description |
---|
BasicCommandTaskExecutor()
Creates a new instance.
|
BasicCommandTaskExecutor(Function<? super TaskExecutionContext,? extends CommandLauncher> launchers)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
static void |
execute(TaskExecutionContext context,
CommandLauncher launcher,
Path command,
List<String> arguments)
Executes a command.
|
static void |
execute(TaskExecutionContext context,
Path command,
List<String> arguments)
Executes a command.
|
void |
execute(TaskExecutionContext context,
TaskInfo task)
Executes a task.
|
static CommandLauncher |
getCommandLauncher(ExecutionContext context)
Returns a
CommandLauncher . |
static CommandLauncher |
getCommandLauncher(ExecutionContext context,
BasicCommandLauncher.OutputConsumer output)
Returns a
CommandLauncher . |
boolean |
isSupported(TaskExecutionContext context,
TaskInfo task)
Returns whether this executor supports executing the target task.
|
public static final boolean WINDOWS
public BasicCommandTaskExecutor()
public BasicCommandTaskExecutor(Function<? super TaskExecutionContext,? extends CommandLauncher> launchers)
launchers
- the command launcher providerpublic boolean isSupported(TaskExecutionContext context, TaskInfo task)
TaskExecutor
isSupported
in interface TaskExecutor
context
- the current contexttask
- the target tasktrue
if this supports the target task, otherwise false
public void execute(TaskExecutionContext context, TaskInfo task) throws InterruptedException, IOException
TaskExecutor
execute
in interface TaskExecutor
context
- the current contexttask
- the target taskInterruptedException
- if interrupted while executing the taskIOException
- if task execution was failedpublic static CommandLauncher getCommandLauncher(ExecutionContext context)
CommandLauncher
.context
- the current contextpublic static CommandLauncher getCommandLauncher(ExecutionContext context, BasicCommandLauncher.OutputConsumer output)
CommandLauncher
.context
- the current contextoutput
- the output targetpublic static void execute(TaskExecutionContext context, Path command, List<String> arguments) throws IOException, InterruptedException
context
- the current contextcommand
- the command patharguments
- the resolved argumentsIOException
- if I/O error was occurred while executing the commandInterruptedException
- if interrupted while executing the commandpublic static void execute(TaskExecutionContext context, CommandLauncher launcher, Path command, List<String> arguments) throws IOException, InterruptedException
context
- the current contextlauncher
- the command launchercommand
- the command patharguments
- the resolved argumentsIOException
- if I/O error was occurred while executing the commandInterruptedException
- if interrupted while executing the commandCopyright © 2011–2019 Asakusa Framework Team. All rights reserved.