Class ProcessObserver


  • public class ProcessObserver
    extends Object
    An observer that notifies its handlers about lines of characters that have been written by a process to both stdout and stderr output streams.
     TODO
    
     Develop External Process Invocation API (EPIA)
    
     - idea: use velocity to generate input files + command-line from current context
     - address that executables might have different extensions (and paths) on different OS (.exe, .bat, .sh)
    
     Process Descriptor
    
     - name
     - description
    
     - n input descriptors (descriptor: name + type + description)
     - n output descriptors (descriptor: name + type + description)
     - n parameter descriptors (descriptor: name + type + description + attributes)
     - 1 command-line velocity template
     - 1 relative working directory template
     - n environment variables templates
     - n velocity file templates
     - n static files
     - n static archives to unpack
    
     Process Invocation
    
     - prepare context:
     set environment variables
     set inputs, outputs, parameters
    
     
    • Constructor Detail

      • ProcessObserver

        public ProcessObserver​(Process process)
        Constructor.
        Parameters:
        process - The process to be observed
    • Method Detail

      • getName

        public String getName()
        Returns:
        A name that represents the process.
      • setName

        public ProcessObserver setName​(String name)
        Default is "process".
        Parameters:
        name - A name that represents the process.
        Returns:
        this
      • getProgressMonitor

        public ProgressMonitor getProgressMonitor()
        Returns:
        A progress monitor.
      • setProgressMonitor

        public ProcessObserver setProgressMonitor​(ProgressMonitor progressMonitor)
        Default does nothing.
        Parameters:
        progressMonitor - A progress monitor.
        Returns:
        this
      • getPollPeriod

        public int getPollPeriod()
        Returns:
        Time in milliseconds between successive process status queries.
      • setPollPeriod

        public ProcessObserver setPollPeriod​(int pollPeriod)
        Default is 500 milliseconds.
        Parameters:
        pollPeriod - Time in milliseconds between successive process status queries.
        Returns:
        this