Class InterfacePipeline

java.lang.Object
All Implemented Interfaces:
java.awt.datatransfer.Transferable, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<PipelineTask>, InterfaceObject, NamedObject, TaskTreeNodeListener, TreeObject, CleanableObject, XMLObject, PipelineTaskListener, IconObject

public class InterfacePipeline
extends PipelineTask
implements PipelineTaskListener
Represents a series of Tasks that are to be run sequentially, such that the output of a task becomes the input of the subsequent one.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
See Also:
Serialized Form
  • Field Details

    • state

      protected PipelineState state
    • root_pipeline

      protected InterfacePipeline root_pipeline
    • tasks

      protected java.util.LinkedList<PipelineTask> tasks
    • assigned_project

      protected InterfaceProject assigned_project
    • instance

      protected java.lang.String instance
    • data_flavor

      protected static java.awt.datatransfer.DataFlavor data_flavor
    • terminate_on_failure

      protected boolean terminate_on_failure
  • Constructor Details

    • InterfacePipeline

      public InterfacePipeline()
    • InterfacePipeline

      public InterfacePipeline​(java.lang.String name)
    • InterfacePipeline

      public InterfacePipeline​(java.lang.String name, java.util.LinkedList<PipelineTask> processes)
  • Method Details

    • getCurrentInstance

      public java.lang.String getCurrentInstance()
    • setProject

      public void setProject​(InterfaceProject project)
    • getRootDir

      public java.io.File getRootDir()
    • addStaticListener

      public void addStaticListener​(StaticPipelineListener listener)
    • removeStaticListener

      public void removeStaticListener​(StaticPipelineListener listener)
    • fireStaticListeners

      protected void fireStaticListeners​(StaticPipelineEvent event)
    • addDynamicListener

      public void addDynamicListener​(DynamicPipelineListener listener)
    • removeDynamicListener

      public void removeDynamicListener​(DynamicPipelineListener listener)
    • firePipelineTaskLaunched

      protected void firePipelineTaskLaunched​(PipelineTask task)
    • firePipelineTaskTerminated

      protected void firePipelineTaskTerminated​(PipelineTask task)
    • firePipelineTaskUpdated

      protected void firePipelineTaskUpdated​(PipelineTask task)
    • firePipelineLaunched

      protected void firePipelineLaunched()
    • firePipelineTerminated

      protected void firePipelineTerminated()
    • setPipeline

      public void setPipeline​(InterfacePipeline pipeline)
      Specified by:
      setPipeline in class PipelineTask
    • getPipeline

      public InterfacePipeline getPipeline()
      Specified by:
      getPipeline in class PipelineTask
    • getState

      public PipelineState getState()
      Returns the state of this pipeline, or the root pipeline if this is not the root.
      Returns:
    • getDataFlavor

      public java.awt.datatransfer.DataFlavor getDataFlavor()
      Specified by:
      getDataFlavor in class PipelineTask
    • setRootDirectory

      public boolean setRootDirectory​(java.io.File d)
    • setSubject

      public void setSubject​(java.lang.String subject)
    • append

      public void append​(PipelineTask process)
    • fireTaskModified

      public void fireTaskModified​(PipelineTask task)
    • resetTaskInstances

      public void resetTaskInstances()
    • setTaskInstance

      public void setTaskInstance​(PipelineTask task)
    • push

      public void push​(PipelineTask process)
    • insert

      public void insert​(int index, PipelineTask process)
    • remove

      public void remove​(PipelineTask process)
    • insertBefore

      public void insertBefore​(PipelineTask existing_task, PipelineTask new_task)
      Insert existing_task before new_task.
      Parameters:
      existing_task -
      new_task -
    • getTaskAtIndex

      public PipelineTask getTaskAtIndex​(int index)
    • getTaskIndex

      public int getTaskIndex​(PipelineTask task)
    • getTasks

      public java.util.LinkedList<PipelineTask> getTasks()
    • reset

      public void reset()
      Description copied from class: PipelineTask
      Resets this task, and sets its status to NotStarted.
      Overrides:
      reset in class PipelineTask
    • interrupt

      public boolean interrupt() throws PipelineException
      Description copied from class: PipelineTask
      Attempts to terminate the execution of this task, if it is started, and sets its status to Terminated.
      Overrides:
      interrupt in class PipelineTask
      Throws:
      PipelineException
    • launch

      public boolean launch​(java.lang.String instance, java.lang.String root_dir, boolean blocking) throws PipelineException
      Description copied from class: PipelineTask
      Launches this task with the given project instance and root directory
      Specified by:
      launch in class PipelineTask
      Parameters:
      instance - The project instance for which to launch this task
      root_dir - The project root directory
      blocking - Indicates whether this task should block or return immediately
      Returns:
      true, if this launch was successful
      Throws:
      PipelineException - If some exception was encountered during execution
    • launch

      public boolean launch​(java.lang.String instance, InterfaceProject project, boolean blocking) throws PipelineException
      Specified by:
      launch in class PipelineTask
      Throws:
      PipelineException
    • launch

      public boolean launch​(java.lang.String instance, java.lang.String root) throws PipelineException
      Description copied from class: PipelineTask
      Launches this task with the given project instance and root directory
      Specified by:
      launch in class PipelineTask
      Parameters:
      instance - The project instance for which to launch this task
      root - The project root directory
      Returns:
      true, if this launch was successful
      Throws:
      PipelineException - If some exception was encountered during execution
    • launch

      public boolean launch() throws PipelineException
      Description copied from class: PipelineTask
      Launches this task
      Specified by:
      launch in class PipelineTask
      Returns:
      true, if this launch was successful
      Throws:
      PipelineException - If some exception was encountered during execution
    • launch

      public boolean launch​(boolean blocking) throws PipelineException
      Description copied from class: PipelineTask
      Launches this task
      Specified by:
      launch in class PipelineTask
      Parameters:
      blocking - Indicates whether this task should block or return immediately
      Returns:
      true, if this launch was successful
      Throws:
      PipelineException - If some exception was encountered during execution
    • taskStatusChanged

      public void taskStatusChanged​(PipelineTaskEvent e)
      Specified by:
      taskStatusChanged in interface PipelineTaskListener
    • getSuccessMessage

      public java.lang.String getSuccessMessage()
      Description copied from class: PipelineTask
      Message to display if this task terminated successfully
      Specified by:
      getSuccessMessage in class PipelineTask
      Returns:
    • getFailureMessage

      public java.lang.String getFailureMessage()
      Description copied from class: PipelineTask
      Message to display if this task failed
      Specified by:
      getFailureMessage in class PipelineTask
      Returns:
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • getObjectIcon

      public javax.swing.Icon getObjectIcon()
      Description copied from interface: IconObject
      Returns the Icon associated with this object.
      Specified by:
      getObjectIcon in interface IconObject
      Returns:
    • setTreeNode

      public void setTreeNode​(InterfaceTreeNode node)
      Description copied from interface: TreeObject
      Sets the children for this node's InterfaceTreeNode.
      Specified by:
      setTreeNode in interface TreeObject
      Overrides:
      setTreeNode in class AbstractInterfaceObject
    • getXML

      public java.lang.String getXML​(int tab)
      Description copied from interface: XMLObject
      Returns this object's XML representation as a single string. NOTE: this is not feasible for larger objects and containers, thus may not be implemented for these objects. Use the XMLObject.writeXML(int,java.io.Writer,mgui.io.standard.xml.XMLOutputOptions,mgui.interfaces.ProgressUpdater) functions to write larger objects to file.
      Specified by:
      getXML in interface XMLObject
      Overrides:
      getXML in class PipelineTask
      Parameters:
      tab - The number of tabs to place before the opening XML wrapper
      Returns:
    • writeXML

      public void writeXML​(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar) throws java.io.IOException
      Description copied from interface: XMLObject
      Writes the XML representation of this object to file. The basic contract for this method is that it should not write a newline character at its start or end. The default format of XMLFormat.Ascii will be used.
      Specified by:
      writeXML in interface XMLObject
      Overrides:
      writeXML in class PipelineTask
      Parameters:
      tab - The number of tabs to place before the XML text
      writer - The writer
      options - XMLOutputOptions defining the write parameters
      progress_bar - Optional progress updater (may be null)
      Throws:
      java.io.IOException
    • clone

      public java.lang.Object clone() throws java.lang.CloneNotSupportedException
      Overrides:
      clone in class PipelineTask
      Throws:
      java.lang.CloneNotSupportedException