JobExecutionContext in JobDataMapjob and Detail and Trigger in JobDataMapjob

static void main public (String [] args) { 
// build mode configuration mode
// 1. Examples of a the JOB
the JobDetail jobDetail = JobBuilder. newJob (QuartzJob. class)
.withIdentity ( "The myjob", "Group")
// in JobDataMap when building JobDetail, data may be placed into the JobDataMap,
.usingJobData ( "jobSays", "! the Hello World")
.usingJobData ( "myFloatValue", 3.14f)
.build ();
//2.0 instance trigger
the trigger trigger = newTrigger ()
.withIdentity ( "trigger1", "group1")
.startNow ()
.withSchedule ( simpleSchedule () // configure the Simple ways to configure your own corn Baidu
.withIntervalInSeconds(4)
.repeatForever ())
.usingJobData ( "jobSays", "2222")
.usingJobData ( "myFloatValue", 3.004f)
.build ();
//3.0 scheduler schedules instantiated, the instance of the integration job and triggers the try { Scheduler . = the StdSchedulerFactory Scheduler getDefaultScheduler (); scheduler.scheduleJob (jobDetail, Trigger); .. 4 // start scheduler.start (); } the catch (SchedulerException E) { e.printStackTrace (); } }













This shows that when the J key encounter the same name value obExecutionContext in JobDataMapjob will take
JobDataMapjob value of Trigger.
So Trigger in JobDataMapjob value. Value will cover JobDataMapjob



This method can get dataMap value jobDetail inside and Trigger (realized java> Map)

Guess you like

Origin www.cnblogs.com/wangbiaohistory/p/12039884.html