Class AbstractProcessExec
- java.lang.Object
-
- com.anrisoftware.globalpom.exec.internal.scriptprocess.AbstractProcessExec
-
- All Implemented Interfaces:
ScriptExec,Callable<ProcessTask>
- Direct Known Subclasses:
ScriptExecImpl
public abstract class AbstractProcessExec extends Object implements ScriptExec
Executes a script.- Since:
- 2.3
- Author:
- Erwin Mueller, erwin.mueller@deventm.org
-
-
Field Summary
Fields Modifier and Type Field Description static StringDESTROY_ON_TIMEOUT_ARGstatic booleanDESTROY_ON_TIMEOUT_DEFAULTDefaultdestroyOnTimeoutvalue, set totrue.static BooleanERR_STRING_DEFAULTDefaulterrStringvalue, set tofalse.static StringEXIT_CODE_ARGstatic intEXIT_CODE_DEFAULTDefaultexitCodevalue, set to0.static StringEXIT_CODES_ARGstatic booleanOUT_STRING_DEFAULTDefaultoutStringvalue, set tofalse.static StringTIMEOUT_ARG_ARGstatic org.joda.time.DurationTIMEOUT_DEFAULTDefaulttimeoutduration, set to 60 seconds.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractProcessExec(Threads threads, Map<String,Object> args)Sets the threads pool and the arguments.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ProcessTaskcall()Executes the script.protected abstract CommandLinecreateCommandLine(ScriptCommandLineFactory commandLineFactory)Creates the command line for the process.StringgetScriptString()Returns the script that was executed.protected voidsetupCommandError(CommandExec script, CommandLine line)protected voidsetupCommandOutput(CommandExec script, CommandLine line)
-
-
-
Field Detail
-
ERR_STRING_DEFAULT
public static final Boolean ERR_STRING_DEFAULT
DefaulterrStringvalue, set tofalse.
-
OUT_STRING_DEFAULT
public static final boolean OUT_STRING_DEFAULT
DefaultoutStringvalue, set tofalse.- See Also:
- Constant Field Values
-
DESTROY_ON_TIMEOUT_DEFAULT
public static final boolean DESTROY_ON_TIMEOUT_DEFAULT
DefaultdestroyOnTimeoutvalue, set totrue.- See Also:
- Constant Field Values
-
EXIT_CODE_DEFAULT
public static final int EXIT_CODE_DEFAULT
DefaultexitCodevalue, set to0.- See Also:
- Constant Field Values
-
TIMEOUT_DEFAULT
public static final org.joda.time.Duration TIMEOUT_DEFAULT
Defaulttimeoutduration, set to 60 seconds.
-
TIMEOUT_ARG_ARG
public static final String TIMEOUT_ARG_ARG
- See Also:
- Constant Field Values
-
DESTROY_ON_TIMEOUT_ARG
public static final String DESTROY_ON_TIMEOUT_ARG
- See Also:
- Constant Field Values
-
EXIT_CODES_ARG
public static final String EXIT_CODES_ARG
- See Also:
- Constant Field Values
-
EXIT_CODE_ARG
public static final String EXIT_CODE_ARG
- See Also:
- Constant Field Values
-
-
Method Detail
-
call
public ProcessTask call() throws CommandExecException
Description copied from interface:ScriptExecExecutes the script.- Specified by:
callin interfaceCallable<ProcessTask>- Specified by:
callin interfaceScriptExec- Throws:
CommandExecException
-
getScriptString
public String getScriptString()
Description copied from interface:ScriptExecReturns the script that was executed.- Specified by:
getScriptStringin interfaceScriptExec- Returns:
- the script
String.
-
createCommandLine
protected abstract CommandLine createCommandLine(ScriptCommandLineFactory commandLineFactory)
Creates the command line for the process.- Parameters:
commandLineFactory- theScriptCommandLineFactory.- Returns:
- the
CommandLine.
-
setupCommandOutput
protected void setupCommandOutput(CommandExec script, CommandLine line)
-
setupCommandError
protected void setupCommandError(CommandExec script, CommandLine line)
-
-