Package mgui.pipelines
Class JavaProcess
java.lang.Object
mgui.pipelines.PipelineProcess
mgui.pipelines.JavaProcess
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,InterfaceObject
,NamedObject
,TreeObject
,CleanableObject
,XMLObject
,IconObject
- Direct Known Subclasses:
CaminoProcess
public class JavaProcess extends PipelineProcess
Represents a Java process; i.e., a class containing a
main
method which allows it
to be run as a process.- 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.util.HashMap<java.lang.Long,CommandInstance>
current_system_processes
protected boolean
is_interrupted
protected java.lang.String
main_class
Fields inherited from class mgui.pipelines.PipelineProcess
help_param, input_parameter, library, logger, name, output_parameter, parameters
-
Constructor Summary
Constructors Constructor Description JavaProcess(java.lang.String name, java.lang.String main_class)
JavaProcess(java.lang.String name, java.lang.String main_class, java.lang.String input_parameter, java.lang.String output_parameter)
JavaProcess(java.lang.String name, java.lang.String main_class, java.lang.String input_parameter, java.lang.String output_parameter, java.lang.String logger)
JavaProcess(PipelineProcess process)
-
Method Summary
Modifier and Type Method Description java.lang.Object
clone()
java.lang.String
getFailureMessage()
Returns the message to be displayed when this process has failed.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
getMainClass()
javax.swing.Icon
getObjectIcon()
Returns theIcon
associated with this object.java.lang.String[]
getOutputArgs(java.lang.String[] args, java.lang.String input_file)
Alters an argument array to set an output file for this process, and returns the result.java.lang.String
getSuccessMessage()
Returns the message to be displayed when this process has succeeded.java.lang.String
getXML(int tab)
Returns this object's XML representation as a single string.boolean
interrupt(long uid)
Interrupts an instance of this processboolean
isInterrupted()
boolean
run(java.lang.String[] args, long uid)
Runs an instance of this processvoid
setFromProcess(PipelineProcess process)
void
setMainClass(java.lang.String mainClass)
void
showHelp()
Attempt to display the associated help messageMethods inherited from class mgui.pipelines.PipelineProcess
addParameter, clean, destroy, getCompoundName, getDTD, getHelpParameter, getIcon, getInputParameter, getInstance, getLibrary, getLocalName, getLogger, getName, getOutputParameter, getParameter, getParameters, getShortXML, getTreeLabel, getXML, getXMLSchema, handleXMLElementEnd, handleXMLElementStart, handleXMLString, insertParameter, isDestroyed, issueTreeNode, removeParameter, setHelpParameter, setInputParameter, setLibrary, setLogger, setName, setOutputParameter, setParameters, setTreeNode, toString, updateLogger, writeXML, writeXML, writeXML
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
main_class
protected java.lang.String main_class -
is_interrupted
protected boolean is_interrupted -
current_system_processes
-
-
Constructor Details
-
JavaProcess
-
JavaProcess
public JavaProcess(java.lang.String name, java.lang.String main_class) -
JavaProcess
public JavaProcess(java.lang.String name, java.lang.String main_class, java.lang.String input_parameter, java.lang.String output_parameter) -
JavaProcess
public JavaProcess(java.lang.String name, java.lang.String main_class, java.lang.String input_parameter, java.lang.String output_parameter, java.lang.String logger)
-
-
Method Details
-
setFromProcess
- Overrides:
setFromProcess
in classPipelineProcess
-
getObjectIcon
public javax.swing.Icon getObjectIcon()Description copied from interface:IconObject
Returns theIcon
associated with this object.- Specified by:
getObjectIcon
in interfaceIconObject
- Overrides:
getObjectIcon
in classPipelineProcess
- Returns:
-
showHelp
public void showHelp()Description copied from class:PipelineProcess
Attempt to display the associated help message- Specified by:
showHelp
in classPipelineProcess
-
getSuccessMessage
public java.lang.String getSuccessMessage()Description copied from class:PipelineProcess
Returns the message to be displayed when this process has succeeded.- Specified by:
getSuccessMessage
in classPipelineProcess
- Returns:
-
getFailureMessage
public java.lang.String getFailureMessage()Description copied from class:PipelineProcess
Returns the message to be displayed when this process has failed.- Specified by:
getFailureMessage
in classPipelineProcess
- Returns:
-
clone
public java.lang.Object clone()- Specified by:
clone
in classPipelineProcess
-
run
Description copied from class:PipelineProcess
Runs an instance of this process- Specified by:
run
in classPipelineProcess
- Parameters:
args
- Arguments for the process- Returns:
- Throws:
PipelineException
-
interrupt
Description copied from class:PipelineProcess
Interrupts an instance of this process- Specified by:
interrupt
in classPipelineProcess
- Parameters:
uid
- The unique identifier of the process instance to interrupt- Returns:
- Throws:
PipelineException
-
isInterrupted
public boolean isInterrupted() -
getMainClass
public java.lang.String getMainClass() -
setMainClass
public void setMainClass(java.lang.String mainClass) -
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.- Specified by:
getXML
in interfaceXMLObject
- Overrides:
getXML
in classPipelineProcess
- Parameters:
tab
- The number of tabs to place before the opening XML wrapper- Returns:
-
getInputArgs
public java.lang.String[] getInputArgs(java.lang.String[] args, java.lang.String input_file)Description copied from class:PipelineProcess
Alters an argument array to set an input file for this process, and returns the result.- Specified by:
getInputArgs
in classPipelineProcess
- Returns:
-
getOutputArgs
public java.lang.String[] getOutputArgs(java.lang.String[] args, java.lang.String input_file)Description copied from class:PipelineProcess
Alters an argument array to set an output file for this process, and returns the result.- Specified by:
getOutputArgs
in classPipelineProcess
- Returns:
-