Class AbstractPythonExecution

    • Field Detail

      • m_OutputType

        protected com.github.fracpete.processoutput4j.core.StreamingProcessOutputType m_OutputType
        whether to output stderr instead of stdout or both.
      • m_PrefixStdOut

        protected String m_PrefixStdOut
        the stdout prefix.
      • m_PrefixStdErr

        protected String m_PrefixStdErr
        the stderr prefix.
      • m_Output

        protected List m_Output
        the tokens to forward.
      • m_ProcessOutput

        protected transient com.github.fracpete.processoutput4j.output.StreamingProcessOutput m_ProcessOutput
        the process monitor.
      • m_ExecutionFailure

        protected IllegalStateException m_ExecutionFailure
        in case an exception occurred executing the command (gets rethrown).
      • m_TimeOut

        protected int m_TimeOut
        the time out in seconds.
    • Constructor Detail

      • AbstractPythonExecution

        public AbstractPythonExecution()
    • Method Detail

      • reset

        protected void reset()
        Resets the scheme.
        Overrides:
        reset in class AbstractActor
      • setOutputType

        public void setOutputType​(com.github.fracpete.processoutput4j.core.StreamingProcessOutputType value)
        Sets what output from the process to forward.
        Parameters:
        value - the output type
      • getOutputType

        public com.github.fracpete.processoutput4j.core.StreamingProcessOutputType getOutputType()
        Returns what output from the process to forward.
        Specified by:
        getOutputType in interface com.github.fracpete.processoutput4j.core.StreamingProcessOwner
        Returns:
        the output type
      • outputTypeTipText

        public String outputTypeTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setPrefixStdOut

        public void setPrefixStdOut​(String value)
        Sets the (optional) prefix to use for output from stdout.
        Parameters:
        value - the prefix
      • getPrefixStdOut

        public String getPrefixStdOut()
        Returns the (optional) prefix to use for output from stdout.
        Returns:
        the prefix
      • prefixStdOutTipText

        public String prefixStdOutTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setPrefixStdErr

        public void setPrefixStdErr​(String value)
        Sets the (optional) prefix to use for output from stderr.
        Parameters:
        value - the prefix
      • getPrefixStdErr

        public String getPrefixStdErr()
        Returns the (optional) prefix to use for output from stderr.
        Returns:
        the prefix
      • prefixStdErrTipText

        public String prefixStdErrTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setTimeOut

        public void setTimeOut​(int value)
        Sets the time out for the process.
        Parameters:
        value - the time out in seconds
      • getTimeOut

        public int getTimeOut()
        Returns the time out for the process.
        Returns:
        the time out in seconds
      • timeOutTipText

        public String timeOutTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • generates

        public Class[] generates()
        Returns the class of objects that it generates.
        Specified by:
        generates in interface OutputProducer
        Returns:
        java.lang.String.class
      • launch

        protected String launch​(List<String> cmd,
                                String workingDir)
        Launches the command.
        Parameters:
        cmd - the command and its options
        workingDir - the working directory, ignored if empty
        Returns:
        null if everything is fine, otherwise error message
      • processOutput

        public void processOutput​(String line,
                                  boolean stdout)
        Adds the line from the output to the internal list of lines to output.
        Specified by:
        processOutput in interface com.github.fracpete.processoutput4j.core.StreamingProcessOwner
        Parameters:
        line - the line to add
        stdout - whether stdout or stderr
      • output

        public Token output()
        Returns the generated token.
        Specified by:
        output in interface OutputProducer
        Returns:
        the generated token
      • hasPendingOutput

        public boolean hasPendingOutput()
        Checks whether there is pending output to be collected after executing the flow item.
        Specified by:
        hasPendingOutput in interface OutputProducer
        Returns:
        true if there is pending output