public class Processor extends Object
ScriptModule
s that generate scripts will submit a main script to the OS for execution as a
Processor
.Modifier and Type | Class and Description |
---|---|
class |
Processor.SubProcess
Class used to submit processes on their own Thread.
|
Modifier and Type | Method and Description |
---|---|
static String |
getBashVar(String bashVar)
Return the value of the bash variable from the runtime shell.
|
void |
runJob(String[] args,
String label)
Execute the command args and log output with label.
|
static void |
runSubprocess(String[] args,
String label)
Instantiates a new
Processor .String[] array used to control spacing between command/params. As if executing on terminal args[0] args[1]... |
static void |
setFilePermissions(String path,
String permissions)
Set file permissions by executing chmod "script.permissions" on generated
bash scripts.
|
static void |
submit(ScriptModule module)
This method is called by script generating
ScriptModule s to update the script
file-permissions to ensure they are executable by the program. |
static void |
submit(String[] args,
String label)
Instantiates a new
Processor .String[] array used to control spacing between command/params. As if executing on terminal args[0] args[1]... |
public void runJob(String[] args, String label) throws Exception
args
- Command argslabel
- Log labelException
- if errors occur in the Processorpublic static String getBashVar(String bashVar) throws Exception
bashVar
- Bash variable nameException
- if errors occur running the scriptpublic static void runSubprocess(String[] args, String label)
Processor
.args
- Terminal command created from args (adds 1 space between each array element)label
- to associate with the processpublic static void setFilePermissions(String path, String permissions) throws Exception
path
- Target directory pathpermissions
- Set the chmod security bits (ex 764)Exception
- if chmod command command failspublic static void submit(ScriptModule module) throws Exception
ScriptModule
s to update the script
file-permissions to ensure they are executable by the program. Once file permissions are set, the main script
(passed in the args param) is executed. Calls setFilePermissions(String, String)
and
submit(ScriptModule)
module
- ScriptModule that is submitting its main script as a ProcessorException
- if errors occur during executionpublic static void submit(String[] args, String label) throws Exception
Processor
.args
- Terminal command created from args (adds 1 space between each array element)label
- - Process labelException
- if errors occur during execution