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.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 representationabstract 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 theIcon
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 representationvoid
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 processboolean
isDestroyed()
Test whether this object has been destroyedInterfaceTreeNode
issueTreeNode()
Issues a newInterfaceTreeNode
for this object.boolean
removeParameter(java.lang.String name)
abstract boolean
run(java.lang.String[] args, long uid)
Runs an instance of this processvoid
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'sInterfaceTreeNode
.abstract void
showHelp()
Attempt to display the associated help messagejava.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, asXMLType.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
-
library
-
-
Constructor Details
-
PipelineProcess
public PipelineProcess()
-
-
Method Details
-
setLibrary
-
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 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:IconObject
Returns theIcon
associated with this object.- Specified by:
getObjectIcon
in 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:
clone
in classjava.lang.Object
-
getInstance
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
setFromProcess
-
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 representationSee http://en.wikipedia.org/wiki/Document_Type_Definition for a description.
-
getLocalName
public java.lang.String getLocalName()Description copied from interface:XMLObject
Returns the local name associated with this XML object.- Specified by:
getLocalName
in interfaceXMLObject
- 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 interfaceXMLObject
- 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 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: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 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:XMLObject
Returns the XML schema for this object's XML representation- Specified by:
getXMLSchema
in interfaceXMLObject
- 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 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:XMLObject
Handles the start of an XML element.- Specified by:
handleXMLElementStart
in interfaceXMLObject
- Parameters:
localName
- Local name of the elementattributes
- Set of element attributestype
- TheXMLType
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 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:XMLObject
Writes the XML representation of this object to file, asXMLType.Normal
. The default format ofXMLFormat.Ascii
will 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: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 ofXMLFormat.Ascii
will be used. -
writeXML
public void writeXML(int tab, java.io.Writer writer) throws java.io.IOExceptionDescription 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 ofXMLFormat.Ascii
will be used. -
destroy
public void destroy()Description copied from interface:InterfaceObject
Destroy this object (prepare it to be removed from memory)- Specified by:
destroy
in interfaceInterfaceObject
-
getName
public java.lang.String getName()Description copied from interface:NamedObject
Gets the name for this object.- Specified by:
getName
in interfaceNamedObject
- Returns:
-
isDestroyed
public boolean isDestroyed()Description copied from interface:InterfaceObject
Test whether this object has been destroyed- Specified by:
isDestroyed
in interfaceInterfaceObject
- Returns:
-
setName
public void setName(java.lang.String name)Description copied from interface:NamedObject
Sets the name for this object.- Specified by:
setName
in interfaceNamedObject
-
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 interfaceTreeObject
- Returns:
-
issueTreeNode
Description copied from interface:TreeObject
Issues a newInterfaceTreeNode
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 interfaceTreeObject
- Returns:
-
setTreeNode
Description copied from interface:TreeObject
Sets the children for this node'sInterfaceTreeNode
.- Specified by:
setTreeNode
in interfaceTreeObject
-
getParameters
-
setParameters
-
setLogger
public void setLogger(java.lang.String logger)
-