Class AbstractProcessExec
java.lang.Object
com.anrisoftware.globalpom.exec.internal.scriptprocess.AbstractProcessExec
- All Implemented Interfaces:
ScriptExec,Callable<ProcessTask>
- Direct Known Subclasses:
ScriptExecImpl
Executes a script.
- Since:
- 2.3
- Author:
- Erwin Mueller, erwin.mueller@deventm.org
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final booleanDefaultdestroyOnTimeoutvalue, set totrue.static final BooleanDefaulterrStringvalue, set tofalse.static final Stringstatic final intDefaultexitCodevalue, set to0.static final Stringstatic final booleanDefaultoutStringvalue, set tofalse.static final Stringstatic final org.joda.time.DurationDefaulttimeoutduration, set to 60 seconds. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractProcessExec(Threads threads, Map<String, Object> args) Sets the threads pool and the arguments. -
Method Summary
Modifier and TypeMethodDescriptioncall()Executes the script.protected abstract CommandLinecreateCommandLine(ScriptCommandLineFactory commandLineFactory) Creates the command line for the process.Returns the script that was executed.protected voidsetupCommandError(CommandExec script, CommandLine line) protected voidsetupCommandOutput(CommandExec script, CommandLine line)
-
Field Details
-
ERR_STRING_DEFAULT
DefaulterrStringvalue, set tofalse. -
OUT_STRING_DEFAULT
public static final boolean OUT_STRING_DEFAULTDefaultoutStringvalue, set tofalse.- See Also:
-
DESTROY_ON_TIMEOUT_DEFAULT
public static final boolean DESTROY_ON_TIMEOUT_DEFAULTDefaultdestroyOnTimeoutvalue, set totrue.- See Also:
-
EXIT_CODE_DEFAULT
public static final int EXIT_CODE_DEFAULTDefaultexitCodevalue, set to0.- See Also:
-
TIMEOUT_DEFAULT
public static final org.joda.time.Duration TIMEOUT_DEFAULTDefaulttimeoutduration, set to 60 seconds. -
TIMEOUT_ARG_ARG
- See Also:
-
DESTROY_ON_TIMEOUT_ARG
- See Also:
-
EXIT_CODES_ARG
- See Also:
-
EXIT_CODE_ARG
- See Also:
-
-
Constructor Details
-
Method Details
-
call
Description copied from interface:ScriptExecExecutes the script.- Specified by:
callin interfaceCallable<ProcessTask>- Specified by:
callin interfaceScriptExec- Throws:
CommandExecException
-
getScriptString
Description copied from interface:ScriptExecReturns the script that was executed.- Specified by:
getScriptStringin interfaceScriptExec- Returns:
- the script
String.
-
createCommandLine
Creates the command line for the process.- Parameters:
commandLineFactory- theScriptCommandLineFactory.- Returns:
- the
CommandLine.
-
setupCommandOutput
-
setupCommandError
-