public class CommandJobHandler extends JobHandler<String>
The job handler for executes system operation command.
/bin/bash -c "echo $(date +%Y/%m/%d)"
Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", "echo $(date +%Y/%m/%d)"});
bin/bash -c 后面接 命令
/bin/bash 后面接 执行的脚本
| 限定符和类型 | 类和说明 |
|---|---|
static class |
CommandJobHandler.CommandParam |
log| 构造器和说明 |
|---|
CommandJobHandler() |
| 限定符和类型 | 方法和说明 |
|---|---|
Result<String> |
execute(ExecutingTask executingTask,
Checkpoint checkpoint)
Executes task
|
destroy, init, isStopped, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsplitpublic Result<String> execute(ExecutingTask executingTask, Checkpoint checkpoint) throws Exception
TaskExecutorexecute 在类中 TaskExecutor<String>executingTask - the executing taskcheckpoint - the checkpointException - if execute failedCopyright © 2023. All rights reserved.