Package com.platformlib.process.executor
Class DefaultProcessExecutor
- java.lang.Object
-
- com.platformlib.process.executor.DefaultProcessExecutor
-
- All Implemented Interfaces:
ProcessExecutor
public abstract class DefaultProcessExecutor extends java.lang.Object implements ProcessExecutor
Default process executor.
-
-
Constructor Summary
Constructors Constructor Description DefaultProcessExecutor(ProcessConfiguration processConfiguration)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidclose()protected voidcloseResource(java.io.Closeable stream)protected voiddumpCommandAndArguments(java.lang.Object... commandAndArguments)protected java.util.Optional<ProcessDryRunConfiguration>getDryRunConfiguration()protected java.util.Map<java.lang.String,java.lang.String>getEnvVariables()longgetExecutionId()protected java.util.concurrent.ExecutorgetExecutor()protected java.util.Optional<org.slf4j.Logger>getLogger()protected java.util.List<java.lang.String>getMaskedCommandAndArguments(java.lang.Object... commandAndArguments)protected ProcessDestroyerHandlergetProcessDestroyerHandler()protected DefaultProcessOutputgetProcessStdErr()protected DefaultProcessOutputgetProcessStdOut()java.io.InputStreamgetStdErrInputStream()Get process standard error stream.protected java.util.Optional<java.io.InputStream>getStdIn()java.io.InputStreamgetStdOutInputStream()Get process standard output stream.protected java.util.List<java.lang.String>getUnmaskedCommandAndArguments(java.lang.Object... commandAndArguments)Get command line and arguments to execute.protected java.util.Optional<java.lang.String>getWorkDirectory()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.platformlib.process.executor.ProcessExecutor
execute
-
-
-
-
Constructor Detail
-
DefaultProcessExecutor
public DefaultProcessExecutor(ProcessConfiguration processConfiguration)
Default constructor.- Parameters:
processConfiguration- process configuration
-
-
Method Detail
-
getStdOutInputStream
public java.io.InputStream getStdOutInputStream()
Description copied from interface:ProcessExecutorGet process standard output stream.- Specified by:
getStdOutInputStreamin interfaceProcessExecutor- Returns:
- Returns
InputStreamprovides process standard output
-
getStdErrInputStream
public java.io.InputStream getStdErrInputStream()
Description copied from interface:ProcessExecutorGet process standard error stream.- Specified by:
getStdErrInputStreamin interfaceProcessExecutor- Returns:
- Returns
InputStreamprovides process standard error
-
getExecutor
protected java.util.concurrent.Executor getExecutor()
-
getLogger
protected java.util.Optional<org.slf4j.Logger> getLogger()
-
getExecutionId
public long getExecutionId()
-
getStdIn
protected java.util.Optional<java.io.InputStream> getStdIn()
-
getEnvVariables
protected java.util.Map<java.lang.String,java.lang.String> getEnvVariables()
-
getWorkDirectory
protected java.util.Optional<java.lang.String> getWorkDirectory()
-
getProcessDestroyerHandler
protected ProcessDestroyerHandler getProcessDestroyerHandler()
-
getDryRunConfiguration
protected java.util.Optional<ProcessDryRunConfiguration> getDryRunConfiguration()
-
getUnmaskedCommandAndArguments
protected java.util.List<java.lang.String> getUnmaskedCommandAndArguments(java.lang.Object... commandAndArguments)
Get command line and arguments to execute. Contains unmasked values.- Parameters:
commandAndArguments- command and arguments to execute. If process is already configured with command line/arguments then given arguments will be added to the command arguments- Returns:
- Returns unmasked command line and argument to execute
-
getMaskedCommandAndArguments
protected java.util.List<java.lang.String> getMaskedCommandAndArguments(java.lang.Object... commandAndArguments)
-
dumpCommandAndArguments
protected void dumpCommandAndArguments(java.lang.Object... commandAndArguments)
-
getProcessStdOut
protected DefaultProcessOutput getProcessStdOut()
-
getProcessStdErr
protected DefaultProcessOutput getProcessStdErr()
-
close
protected void close()
-
closeResource
protected void closeResource(java.io.Closeable stream)
-
-