Class FWFunctionalityPipelineRunner

java.lang.Object
java.lang.Thread
net.simplace.pipe.control.FWFunctionalityPipelineRunner
All Implemented Interfaces:
Runnable

public class FWFunctionalityPipelineRunner extends Thread
Runs the pipeline of a PipeLineFunctionality (parameter PipeID), synchronously via runPipeline() or as thread. After a threaded run the result is passed to the functionality and the GUI goes on to the next function, enables the go button or closes the function.
Author:
Andreas Enders
  • Constructor Details

    • FWFunctionalityPipelineRunner

      public FWFunctionalityPipelineRunner(PipeLineFunctionality aFunctionality, String aInitFileName) throws PipeLineCreationException
      Creates a runner with the pipelines from a definition file.
      Parameters:
      aFunctionality - the functionality providing the parameters
      aInitFileName - name of the pipeline definition file (class path resource)
      Throws:
      PipeLineCreationException - if a pipeline cannot be created
    • FWFunctionalityPipelineRunner

      public FWFunctionalityPipelineRunner(PipeLineFunctionality aFunctionality, org.jdom2.Element aInitElement) throws PipeLineCreationException
      Creates a runner with the pipelines from an element.
      Parameters:
      aFunctionality - the functionality providing the parameters
      aInitElement - element containing the pipelines element
      Throws:
      PipeLineCreationException - if a pipeline cannot be created
  • Method Details

    • runPipeline

      public net.simplace.core.FWObservable runPipeline(int aNumberOfSteps) throws PipeLineException, DatabaseInUseException
      Runs the pipeline given in the parameter PipeID of the functionality. Afterwards the temporary directory TEMPDIR is deleted, unless delete_temp_at_end is false.
      Parameters:
      aNumberOfSteps - maximum number of processors to run
      Returns:
      the result of the pipeline
      Throws:
      PipeLineException - if the pipeline cannot be found or fails
      DatabaseInUseException - if the database is already in use
    • runPipeline

      public net.simplace.core.FWObservable runPipeline() throws PipeLineException, DatabaseInUseException
      Runs all processors of the pipeline given in the parameter PipeID.
      Returns:
      the result of the pipeline
      Throws:
      PipeLineException - if the pipeline cannot be found or fails
      DatabaseInUseException - if the database is already in use
    • run

      public void run()
      Runs the pipeline as thread and passes the filtered result to the functionality. Then goes on to the next function (if go_on_automatically), enables the go button (if there is a next function) or closes the function (hidden if hide_view). Errors are shown in a dialog or logged.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • getPipeLineContainer

      public FWPipeLinesContainer getPipeLineContainer()
      Returns:
      the pipeline container
    • toString

      public String toString()
      Overrides:
      toString in class Thread