|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.quartz.jobs.NativeJob
public class NativeJob
Built in job for executing native executables in a separate process.
JobDetail job = new JobDetail("dumbJob", null, org.quartz.jobs.NativeJob.class);
job.getJobDataMap().put(org.quartz.jobs.NativeJob.PROP_COMMAND, "echo \"hi\" >> foobar.txt");
Trigger trigger = TriggerUtils.makeSecondlyTrigger(5);
trigger.setName("dumbTrigger");
sched.scheduleJob(job, trigger);
If PROP_WAIT_FOR_PROCESS is true, then the Integer exit value of the process
will be saved as the job execution result in the JobExecutionContext.
PROP_COMMAND,
PROP_PARAMETERS,
PROP_WAIT_FOR_PROCESS,
PROP_CONSUME_STREAMS| Field Summary | |
|---|---|
static String |
PROP_COMMAND
Required parameter that specifies the name of the command (executable) to be ran. |
static String |
PROP_CONSUME_STREAMS
Optional parameter (value should be 'true' or 'false') that specifies whether the spawned process's stdout and stderr streams should be consumed. |
static String |
PROP_PARAMETERS
Optional parameter that specifies the parameters to be passed to the executed command. |
static String |
PROP_WAIT_FOR_PROCESS
Optional parameter (value should be 'true' or 'false') that specifies whether the job should wait for the execution of the native process to complete before it completes. |
| Constructor Summary | |
|---|---|
NativeJob()
|
|
| Method Summary | |
|---|---|
void |
execute(org.quartz.JobExecutionContext context)
|
protected org.slf4j.Logger |
getLog()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PROP_COMMAND
public static final String PROP_PARAMETERS
public static final String PROP_WAIT_FOR_PROCESS
Defaults to true.
public static final String PROP_CONSUME_STREAMS
Defaults to false.
| Constructor Detail |
|---|
public NativeJob()
| Method Detail |
|---|
public void execute(org.quartz.JobExecutionContext context)
throws org.quartz.JobExecutionException
execute in interface org.quartz.Joborg.quartz.JobExecutionExceptionprotected org.slf4j.Logger getLog()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||