|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.norconex.jef.exec.SystemCommandJob
public class SystemCommandJob
JEF job for executing an arbitrary number of commands. The job progress is relative to the number of commands to be processed. This is ideal for submitting a batch of small commands where execution time is not long enough to track individual command progresses. For long-running commands, you may want to create a custom job where you can keep track of the command progress and translate that somehow into a job progress (whenever possible).
Constructor Summary | |
---|---|
SystemCommandJob(String id,
String desc,
String command)
Creates a JEF job for executing a system command. |
|
SystemCommandJob(String id,
String desc,
String[] commands)
Creates a JEF job for executing system commands. |
|
SystemCommandJob(String id,
String desc,
SystemCommand command)
Creates a JEF job for executing a system command. |
|
SystemCommandJob(String id,
String desc,
SystemCommand[] commands)
Creates a JEF job for executing system commands. |
Method Summary | |
---|---|
IJobContext |
createJobContext()
Contextual information about the job to run. |
void |
execute(JobProgress progress,
JobSuite suite)
Executes this job. |
String |
getId()
Gets the job unique identifier. |
void |
stop(IJobStatus progress,
JobSuite suite)
Default implementation of this method will check if the SystemCommand it runs is currently holding to a
Process process instance and destroys them. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SystemCommandJob(String id, String desc, String[] commands)
SystemCommand
instances
internally.
id
- job iddesc
- job descriptioncommands
- array of individual commands to be executedSystemCommandJob(String, String, SystemCommand[])
public SystemCommandJob(String id, String desc, String command)
SystemCommand
instance
internally.
id
- job iddesc
- job descriptioncommand
- commands to be executedpublic SystemCommandJob(String id, String desc, SystemCommand[] commands)
id
- job iddesc
- job descriptioncommands
- commands to be executedpublic SystemCommandJob(String id, String desc, SystemCommand command)
id
- job iddesc
- job descriptioncommand
- commands to be executedMethod Detail |
---|
public String getId()
IJob
getId
in interface IJob
public IJobContext createJobContext()
IJob
null
.
createJobContext
in interface IJob
public void execute(JobProgress progress, JobSuite suite)
IJob
JobProgress
.
execute
in interface IJob
progress
- current job progresssuite
- job suite this job is part ofpublic void stop(IJobStatus progress, JobSuite suite)
SystemCommand
it runs is currently holding to a
Process
process instance and destroys them.
If no such instance is found, and even if one is found, there are
no guarantees what will happen. Implementors having better ways to
stop the invoked command should overwrite this method.
stop
in interface IJob
progress
- current job progresssuite
- job suite this job is part of
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |