Adding more examples to the Quartz project (#2101)
This commit is contained in:
committed by
Zeger Hendrikse
parent
eba5b938f5
commit
fada609f16
@@ -1,13 +1,21 @@
|
||||
package com.baeldung.quartz;
|
||||
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobDataMap;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
public class SimpleJob implements Job {
|
||||
|
||||
public void execute(JobExecutionContext arg0) throws JobExecutionException {
|
||||
System.out.println("This is a quartz job!");
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
JobDataMap dataMap = context.getJobDetail()
|
||||
.getJobDataMap();
|
||||
|
||||
String jobSays = dataMap.getString("jobSays");
|
||||
float myFloatValue = dataMap.getFloat("myFloatValue");
|
||||
|
||||
System.out.println("Job says: " + jobSays + ", and val is: " + myFloatValue);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user