Package mgui.pipelines
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.Stringhelp_paramprotected java.lang.Stringinput_parameterprotected PipelineProcessLibrarylibraryprotected java.lang.Stringloggerprotected java.lang.Stringnameprotected java.lang.Stringoutput_parameterprotected java.util.ArrayList<TaskParameter>parameters -
Constructor Summary
Constructors Constructor Description PipelineProcess() -
Method Summary
Modifier and Type Method Description voidaddParameter(TaskParameter p)voidclean()Instructs this object to search its members for any object which has been destroyed, and release the pointer to it.abstract java.lang.Objectclone()voiddestroy()Destroy this object (prepare it to be removed from memory)java.lang.StringgetCompoundName()Returns the compound name of this process, of the form [library_name].[compound_name].java.lang.StringgetDTD()Returns the Data Type Declaration (DTD) for this object's XML representationabstract java.lang.StringgetFailureMessage()Returns the message to be displayed when this process has failed.java.lang.StringgetHelpParameter()Gets the parameter which is used to show a help message for this process.static javax.swing.ImageIcongetIcon()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.StringgetInputParameter()Gets the parameter which is used to determine the input file for this process.PipelineProcessInstancegetInstance(int i)PipelineProcessLibrarygetLibrary()java.lang.StringgetLocalName()Returns the local name associated with this XML object.java.lang.StringgetLogger()java.lang.StringgetName()Gets the name for this object.javax.swing.IcongetObjectIcon()Returns theIconassociated 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.StringgetOutputParameter()Sets the parameter which is used to determine the output file for this process.TaskParametergetParameter(java.lang.String name)java.util.ArrayList<TaskParameter>getParameters()java.lang.StringgetShortXML(int tab)Returns a short XML representation of this object.abstract java.lang.StringgetSuccessMessage()Returns the message to be displayed when this process has succeeded.java.lang.StringgetTreeLabel()Returns the label text to appear in a tree node.java.lang.StringgetXML()Returns this object's XML representation as a single string.java.lang.StringgetXML(int tab)Returns this object's XML representation as a single string.java.lang.StringgetXMLSchema()Returns the XML schema for this object's XML representationvoidhandleXMLElementEnd(java.lang.String localName)Handles the end of an XML element.voidhandleXMLElementStart(java.lang.String localName, org.xml.sax.Attributes attributes, XMLObject.XMLType type)Handles the start of an XML element.voidhandleXMLString(java.lang.String s)Handles a string within an XML element.voidinsertParameter(TaskParameter p, int index)abstract booleaninterrupt(long uid)Interrupts an instance of this processbooleanisDestroyed()Test whether this object has been destroyedInterfaceTreeNodeissueTreeNode()Issues a newInterfaceTreeNodefor this object.booleanremoveParameter(java.lang.String name)abstract booleanrun(java.lang.String[] args, long uid)Runs an instance of this processvoidsetFromProcess(PipelineProcess process)voidsetHelpParameter(java.lang.String parameter)Sets the parameter which is used to show a help message for this process.voidsetInputParameter(java.lang.String parameter)Sets the parameter which is used to determine the input file for this process.voidsetLibrary(PipelineProcessLibrary library)voidsetLogger(java.lang.String logger)voidsetName(java.lang.String name)Sets the name for this object.voidsetOutputParameter(java.lang.String parameter)Sets the parameter which is used to determine the output file for this process.voidsetParameters(java.util.ArrayList<TaskParameter> parameters)voidsetTreeNode(InterfaceTreeNode node)Sets the children for this node'sInterfaceTreeNode.abstract voidshowHelp()Attempt to display the associated help messagejava.lang.StringtoString()voidupdateLogger()voidwriteXML(int tab, java.io.Writer writer)Writes the XML representation of this object to file.voidwriteXML(int tab, java.io.Writer writer, ProgressUpdater progress_bar)Writes the XML representation of this object to file, asXMLType.Normal.voidwriteXML(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
-
library
-
-
Constructor Details
-
PipelineProcess
public PipelineProcess()
-
-
Method Details
-
setLibrary
-
getLibrary
-
clean
public void clean()Description copied from interface:CleanableObjectInstructs this object to search its members for any object which has been destroyed, and release the pointer to it.- Specified by:
cleanin interfaceCleanableObject
-
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:IconObjectReturns theIconassociated with this object.- Specified by:
getObjectIconin interfaceIconObject- 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
Runs an instance of this process- Parameters:
args- Arguments for the processid- Unique identifier for the process instance to run- Returns:
- Throws:
PipelineException
-
interrupt
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
-
insertParameter
-
getParameter
-
removeParameter
public boolean removeParameter(java.lang.String name) -
clone
public abstract java.lang.Object clone()- Overrides:
clonein classjava.lang.Object
-
getInstance
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
setFromProcess
-
getLogger
public java.lang.String getLogger() -
getDTD
public java.lang.String getDTD()Description copied from interface:XMLObjectReturns the Data Type Declaration (DTD) for this object's XML representationSee http://en.wikipedia.org/wiki/Document_Type_Definition for a description.
-
getLocalName
public java.lang.String getLocalName()Description copied from interface:XMLObjectReturns the local name associated with this XML object.- Specified by:
getLocalNamein interfaceXMLObject- Returns:
-
getShortXML
public java.lang.String getShortXML(int tab)Description copied from interface:XMLObjectReturns a short XML representation of this object.- Specified by:
getShortXMLin interfaceXMLObject- Returns:
-
getXML
public java.lang.String getXML()Description copied from interface:XMLObjectReturns 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 theXMLObject.writeXML(int,java.io.Writer,mgui.io.standard.xml.XMLOutputOptions,mgui.interfaces.ProgressUpdater)functions to write larger objects to file. -
getXML
public java.lang.String getXML(int tab)Description copied from interface:XMLObjectReturns 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 theXMLObject.writeXML(int,java.io.Writer,mgui.io.standard.xml.XMLOutputOptions,mgui.interfaces.ProgressUpdater)functions to write larger objects to file. -
getXMLSchema
public java.lang.String getXMLSchema()Description copied from interface:XMLObjectReturns the XML schema for this object's XML representation- Specified by:
getXMLSchemain interfaceXMLObject- Returns:
-
handleXMLElementEnd
public void handleXMLElementEnd(java.lang.String localName)Description copied from interface:XMLObjectHandles the end of an XML element.- Specified by:
handleXMLElementEndin interfaceXMLObject- 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:XMLObjectHandles the start of an XML element.- Specified by:
handleXMLElementStartin interfaceXMLObject- Parameters:
localName- Local name of the elementattributes- Set of element attributestype- TheXMLTypeof this element
-
handleXMLString
public void handleXMLString(java.lang.String s)Description copied from interface:XMLObjectHandles a string within an XML element.- Specified by:
handleXMLStringin interfaceXMLObject- Parameters:
s- String to handle
-
writeXML
public void writeXML(int tab, java.io.Writer writer, ProgressUpdater progress_bar) throws java.io.IOExceptionDescription copied from interface:XMLObjectWrites the XML representation of this object to file, asXMLType.Normal. The default format ofXMLFormat.Asciiwill be used. The basic contract for this method is that it should not write a newline character at its start or end. -
writeXML
public void writeXML(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar) throws java.io.IOExceptionDescription copied from interface:XMLObjectWrites 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 ofXMLFormat.Asciiwill be used. -
writeXML
public void writeXML(int tab, java.io.Writer writer) throws java.io.IOExceptionDescription copied from interface:XMLObjectWrites 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 ofXMLFormat.Asciiwill be used. -
destroy
public void destroy()Description copied from interface:InterfaceObjectDestroy this object (prepare it to be removed from memory)- Specified by:
destroyin interfaceInterfaceObject
-
getName
public java.lang.String getName()Description copied from interface:NamedObjectGets the name for this object.- Specified by:
getNamein interfaceNamedObject- Returns:
-
isDestroyed
public boolean isDestroyed()Description copied from interface:InterfaceObjectTest whether this object has been destroyed- Specified by:
isDestroyedin interfaceInterfaceObject- Returns:
-
setName
public void setName(java.lang.String name)Description copied from interface:NamedObjectSets the name for this object.- Specified by:
setNamein interfaceNamedObject
-
getTreeLabel
public java.lang.String getTreeLabel()Description copied from interface:TreeObjectReturns the label text to appear in a tree node.- Specified by:
getTreeLabelin interfaceTreeObject- Returns:
-
issueTreeNode
Description copied from interface:TreeObjectIssues a newInterfaceTreeNodefor 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:
issueTreeNodein interfaceTreeObject- Returns:
-
setTreeNode
Description copied from interface:TreeObjectSets the children for this node'sInterfaceTreeNode.- Specified by:
setTreeNodein interfaceTreeObject
-
getParameters
-
setParameters
-
setLogger
public void setLogger(java.lang.String logger)
-