Class PipelineProcess

java.lang.Object
mgui.pipelines.PipelineProcess
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, InterfaceObject, NamedObject, TreeObject, CleanableObject, XMLObject, IconObject
Direct Known Subclasses:
JavaProcess, NativeProcess

public abstract class PipelineProcess
extends java.lang.Object
implements InterfaceObject, XMLObject, java.lang.Cloneable, IconObject, java.io.Serializable
Represents a Java process specification, specified by an executable process (native or Java) and a set of parameters.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
See Also:
Serialized Form
  • Nested Class Summary

    Nested classes/interfaces inherited from interface mgui.interfaces.xml.XMLObject

    XMLObject.XMLEncoding, XMLObject.XMLType
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected java.lang.String help_param  
    protected java.lang.String input_parameter  
    protected PipelineProcessLibrary library  
    protected java.lang.String logger  
    protected java.lang.String name  
    protected java.lang.String output_parameter  
    protected java.util.ArrayList<TaskParameter> parameters  
  • Constructor Summary

    Constructors
    Constructor Description
    PipelineProcess()  
  • Method Summary

    Modifier and Type Method Description
    void addParameter​(TaskParameter p)  
    void clean()
    Instructs this object to search its members for any object which has been destroyed, and release the pointer to it.
    abstract java.lang.Object clone()  
    void destroy()
    Destroy this object (prepare it to be removed from memory)
    java.lang.String getCompoundName()
    Returns the compound name of this process, of the form [library_name].[compound_name].
    java.lang.String getDTD()
    Returns the Data Type Declaration (DTD) for this object's XML representation
    abstract java.lang.String getFailureMessage()
    Returns the message to be displayed when this process has failed.
    java.lang.String getHelpParameter()
    Gets the parameter which is used to show a help message for this process.
    static javax.swing.ImageIcon getIcon()  
    abstract java.lang.String[] getInputArgs​(java.lang.String[] args, java.lang.String input_file)
    Alters an argument array to set an input file for this process, and returns the result.
    java.lang.String getInputParameter()
    Gets the parameter which is used to determine the input file for this process.
    PipelineProcessInstance getInstance​(int i)  
    PipelineProcessLibrary getLibrary()  
    java.lang.String getLocalName()
    Returns the local name associated with this XML object.
    java.lang.String getLogger()  
    java.lang.String getName()
    Gets the name for this object.
    javax.swing.Icon getObjectIcon()
    Returns the Icon associated with this object.
    abstract java.lang.String[] getOutputArgs​(java.lang.String[] args, java.lang.String output_file)
    Alters an argument array to set an output file for this process, and returns the result.
    java.lang.String getOutputParameter()
    Sets the parameter which is used to determine the output file for this process.
    TaskParameter getParameter​(java.lang.String name)  
    java.util.ArrayList<TaskParameter> getParameters()  
    java.lang.String getShortXML​(int tab)
    Returns a short XML representation of this object.
    abstract java.lang.String getSuccessMessage()
    Returns the message to be displayed when this process has succeeded.
    java.lang.String getTreeLabel()
    Returns the label text to appear in a tree node.
    java.lang.String getXML()
    Returns this object's XML representation as a single string.
    java.lang.String getXML​(int tab)
    Returns this object's XML representation as a single string.
    java.lang.String getXMLSchema()
    Returns the XML schema for this object's XML representation
    void handleXMLElementEnd​(java.lang.String localName)
    Handles the end of an XML element.
    void handleXMLElementStart​(java.lang.String localName, org.xml.sax.Attributes attributes, XMLObject.XMLType type)
    Handles the start of an XML element.
    void handleXMLString​(java.lang.String s)
    Handles a string within an XML element.
    void insertParameter​(TaskParameter p, int index)  
    abstract boolean interrupt​(long uid)
    Interrupts an instance of this process
    boolean isDestroyed()
    Test whether this object has been destroyed
    InterfaceTreeNode issueTreeNode()
    Issues a new InterfaceTreeNode for this object.
    boolean removeParameter​(java.lang.String name)  
    abstract boolean run​(java.lang.String[] args, long uid)
    Runs an instance of this process
    void setFromProcess​(PipelineProcess process)  
    void setHelpParameter​(java.lang.String parameter)
    Sets the parameter which is used to show a help message for this process.
    void setInputParameter​(java.lang.String parameter)
    Sets the parameter which is used to determine the input file for this process.
    void setLibrary​(PipelineProcessLibrary library)  
    void setLogger​(java.lang.String logger)  
    void setName​(java.lang.String name)
    Sets the name for this object.
    void setOutputParameter​(java.lang.String parameter)
    Sets the parameter which is used to determine the output file for this process.
    void setParameters​(java.util.ArrayList<TaskParameter> parameters)  
    void setTreeNode​(InterfaceTreeNode node)
    Sets the children for this node's InterfaceTreeNode.
    abstract void showHelp()
    Attempt to display the associated help message
    java.lang.String toString()  
    void updateLogger()  
    void writeXML​(int tab, java.io.Writer writer)
    Writes the XML representation of this object to file.
    void writeXML​(int tab, java.io.Writer writer, ProgressUpdater progress_bar)
    Writes the XML representation of this object to file, as XMLType.Normal.
    void writeXML​(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar)
    Writes the XML representation of this object to file.

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • input_parameter

      protected java.lang.String input_parameter
    • output_parameter

      protected java.lang.String output_parameter
    • name

      protected java.lang.String name
    • logger

      protected java.lang.String logger
    • help_param

      protected java.lang.String help_param
    • parameters

      protected java.util.ArrayList<TaskParameter> parameters
    • library

      protected PipelineProcessLibrary library
  • Constructor Details

    • PipelineProcess

      public PipelineProcess()
  • Method Details

    • setLibrary

      public void setLibrary​(PipelineProcessLibrary library)
    • getLibrary

      public PipelineProcessLibrary getLibrary()
    • clean

      public void clean()
      Description copied from interface: CleanableObject
      Instructs this object to search its members for any object which has been destroyed, and release the pointer to it.
      Specified by:
      clean in interface CleanableObject
    • updateLogger

      public void updateLogger()
    • showHelp

      public abstract void showHelp()
      Attempt to display the associated help message
    • 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:
    • getCompoundName

      public java.lang.String getCompoundName()
      Returns the compound name of this process, of the form [library_name].[compound_name].
      Returns:
    • getInputParameter

      public java.lang.String getInputParameter()
      Gets the parameter which is used to determine the input file for this process.
      Returns:
    • setInputParameter

      public void setInputParameter​(java.lang.String parameter)
      Sets the parameter which is used to determine the input file for this process.
    • getOutputParameter

      public java.lang.String getOutputParameter()
      Sets the parameter which is used to determine the output file for this process.
      Returns:
    • setOutputParameter

      public void setOutputParameter​(java.lang.String parameter)
      Sets the parameter which is used to determine the output file for this process.
    • getHelpParameter

      public java.lang.String getHelpParameter()
      Gets the parameter which is used to show a help message for this process.
      Returns:
    • setHelpParameter

      public void setHelpParameter​(java.lang.String parameter)
      Sets the parameter which is used to show a help message for this process.
    • getSuccessMessage

      public abstract java.lang.String getSuccessMessage()
      Returns the message to be displayed when this process has succeeded.
      Returns:
    • getFailureMessage

      public abstract java.lang.String getFailureMessage()
      Returns the message to be displayed when this process has failed.
      Returns:
    • run

      public abstract boolean run​(java.lang.String[] args, long uid) throws PipelineException
      Runs an instance of this process
      Parameters:
      args - Arguments for the process
      id - Unique identifier for the process instance to run
      Returns:
      Throws:
      PipelineException
    • interrupt

      public abstract boolean interrupt​(long uid) throws PipelineException
      Interrupts an instance of this process
      Parameters:
      uid - The unique identifier of the process instance to interrupt
      Returns:
      Throws:
      PipelineException
    • getInputArgs

      public abstract java.lang.String[] getInputArgs​(java.lang.String[] args, java.lang.String input_file)
      Alters an argument array to set an input file for this process, and returns the result.
      Parameters:
      args -
      input_file -
      Returns:
    • getOutputArgs

      public abstract java.lang.String[] getOutputArgs​(java.lang.String[] args, java.lang.String output_file)
      Alters an argument array to set an output file for this process, and returns the result.
      Parameters:
      args -
      output_file -
      Returns:
    • getIcon

      public static javax.swing.ImageIcon getIcon()
    • addParameter

      public void addParameter​(TaskParameter p)
    • insertParameter

      public void insertParameter​(TaskParameter p, int index)
    • getParameter

      public TaskParameter getParameter​(java.lang.String name)
    • removeParameter

      public boolean removeParameter​(java.lang.String name)
    • clone

      public abstract java.lang.Object clone()
      Overrides:
      clone in class java.lang.Object
    • getInstance

      public PipelineProcessInstance getInstance​(int i)
    • toString

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

      public void setFromProcess​(PipelineProcess process)
    • getLogger

      public java.lang.String getLogger()
    • getDTD

      public java.lang.String getDTD()
      Description copied from interface: XMLObject
      Returns the Data Type Declaration (DTD) for this object's XML representation

      See http://en.wikipedia.org/wiki/Document_Type_Definition for a description.

      Specified by:
      getDTD in interface XMLObject
      Returns:
    • getLocalName

      public java.lang.String getLocalName()
      Description copied from interface: XMLObject
      Returns the local name associated with this XML object.
      Specified by:
      getLocalName in interface XMLObject
      Returns:
    • getShortXML

      public java.lang.String getShortXML​(int tab)
      Description copied from interface: XMLObject
      Returns a short XML representation of this object.
      Specified by:
      getShortXML in interface XMLObject
      Returns:
    • getXML

      public java.lang.String getXML()
      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
      Returns:
    • 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
      Parameters:
      tab - The number of tabs to place before the opening XML wrapper
      Returns:
    • getXMLSchema

      public java.lang.String getXMLSchema()
      Description copied from interface: XMLObject
      Returns the XML schema for this object's XML representation

      See http://en.wikipedia.org/wiki/XML_schema.

      Specified by:
      getXMLSchema in interface XMLObject
      Returns:
    • handleXMLElementEnd

      public void handleXMLElementEnd​(java.lang.String localName)
      Description copied from interface: XMLObject
      Handles the end of an XML element.
      Specified by:
      handleXMLElementEnd in interface XMLObject
      Parameters:
      localName - Local name of the element
    • handleXMLElementStart

      public void handleXMLElementStart​(java.lang.String localName, org.xml.sax.Attributes attributes, XMLObject.XMLType type)
      Description copied from interface: XMLObject
      Handles the start of an XML element.
      Specified by:
      handleXMLElementStart in interface XMLObject
      Parameters:
      localName - Local name of the element
      attributes - Set of element attributes
      type - The XMLType of this element
    • handleXMLString

      public void handleXMLString​(java.lang.String s)
      Description copied from interface: XMLObject
      Handles a string within an XML element.
      Specified by:
      handleXMLString in interface XMLObject
      Parameters:
      s - String to handle
    • writeXML

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

      public void writeXML​(int tab, java.io.Writer writer) 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
      Parameters:
      tab - The number of tabs to place before the XML text
      writer - The writer
      Throws:
      java.io.IOException
    • destroy

      public void destroy()
      Description copied from interface: InterfaceObject
      Destroy this object (prepare it to be removed from memory)
      Specified by:
      destroy in interface InterfaceObject
    • getName

      public java.lang.String getName()
      Description copied from interface: NamedObject
      Gets the name for this object.
      Specified by:
      getName in interface NamedObject
      Returns:
    • isDestroyed

      public boolean isDestroyed()
      Description copied from interface: InterfaceObject
      Test whether this object has been destroyed
      Specified by:
      isDestroyed in interface InterfaceObject
      Returns:
    • setName

      public void setName​(java.lang.String name)
      Description copied from interface: NamedObject
      Sets the name for this object.
      Specified by:
      setName in interface NamedObject
    • getTreeLabel

      public java.lang.String getTreeLabel()
      Description copied from interface: TreeObject
      Returns the label text to appear in a tree node.
      Specified by:
      getTreeLabel in interface TreeObject
      Returns:
    • issueTreeNode

      public InterfaceTreeNode issueTreeNode()
      Description copied from interface: TreeObject
      Issues a new InterfaceTreeNode for this object. The object is responsible for maintaining, updating, and destroying the tree nodes it issues, or notifying containers -- i.e., parent trees -- of changes which require the tree nodes to be modified or destroyed.
      Specified by:
      issueTreeNode in interface TreeObject
      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
    • getParameters

      public java.util.ArrayList<TaskParameter> getParameters()
    • setParameters

      public void setParameters​(java.util.ArrayList<TaskParameter> parameters)
    • setLogger

      public void setLogger​(java.lang.String logger)