package Ġcom . temp storage . console . util Ċ Ċ import Ġorg . quartz . Cron Trigger Ċ import Ġorg . quartz . Job DataMap Ċ import Ġorg . quartz . Job Detail Ċ import Ġorg . quartz . Simple Trigger Ċ import Ġorg . slf 4 j . LoggerFactory Ċ import Ġorg . springframework . context . ApplicationContext Ċ import Ġorg . springframework . scheduling . quartz . Cron Trigger Factory Bean Ċ import Ġorg . springframework . scheduling . quartz . Job Detail Factory Bean Ċ import Ġorg . springframework . scheduling . quartz . Qu artz Job Bean Ċ import Ġorg . springframework . scheduling . quartz . Simple Trigger Factory Bean Ċ import Ġorg . springframework . stereotype . Component Ċ import Ġjava . text . ParseException Ċ import Ġjava . util .* Ċ Ċ @ Component Ċ class ĠJob Schedule Creator Ġ{ ĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġlogger Ġ= ĠLoggerFactory . getLogger ( Job Schedule Creator :: class . java ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcreate Job ( job Class : ĠClass < out ĠQu artz Job Bean ? >, Ġis Dur able : ĠBoolean , Ġcontext : ĠApplication Context , Ġjob Name : ĠString , Ġjob Group : ĠString ): ĠJob Detail ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfactory Bean Ġ= ĠJob Detail Factory Bean () ĊĠĠĠĠĠĠĠ Ġfactory Bean . set Job Class ( job Class ) ĊĠĠĠĠĠĠĠ Ġfactory Bean . set Dur ability ( is Dur able ) ĊĠĠĠĠĠĠĠ Ġfactory Bean . set ApplicationContext ( context ) ĊĠĠĠĠĠĠĠ Ġfactory Bean . setName ( job Name ) ĊĠĠĠĠĠĠĠ Ġfactory Bean . set Group ( job Group ) ĊĊĠĠĠĠĠĠĠ Ġ// Ġset Ġjob Ġdata Ġmap ĊĠĠĠĠĠĠĠ Ġval Ġjob DataMap Ġ= ĠJob DataMap () ĊĠĠĠĠĠĠĠ Ġjob DataMap [ job Name Ġ+ Ġjob Group ] Ġ= Ġjob Class . name ĊĠĠĠĠĠĠĠ Ġfactory Bean . job DataMap Ġ= Ġjob DataMap ĊĠĠĠĠĠĠĠ Ġfactory Bean . after Properties Set () ĊĠĠĠĠĠĠĠ Ġreturn Ġfactory Bean . getObject () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcreate Cron Trigger ( trigger Name : ĠString , ĠstartTime : ĠDate , Ġcron Expression : ĠString , Ġmis Fire Instruction : ĠInt ): ĠC ron Trigger ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfactory Bean Ġ= ĠC ron Trigger Factory Bean () ĊĠĠĠĠĠĠĠ Ġfactory Bean . setName ( trigger Name ) ĊĠĠĠĠĠĠĠ Ġfactory Bean . set StartTime ( startTime ) ĊĠĠĠĠĠĠĠ Ġfactory Bean . set Cron Expression ( cron Expression ) ĊĠĠĠĠĠĠĠ Ġfactory Bean . set Mis fire Instruction ( mis Fire Instruction ) ĊĠĠĠĠĠĠĠ Ġtry Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfactory Bean . after Properties Set () ĊĠĠĠĠĠĠĠ Ġ} Ġcatch Ġ( e : ĠParseException ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlogger . error ( e . message , Ġe ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġreturn Ġfactory Bean . getObject () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġcreate Simple Trigger ( trigger Name : ĠString , ĠstartTime : ĠDate , Ġrepeat Time : ĠLong , Ġmis Fire Instruction : ĠInt ): ĠSimple Trigger ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfactory Bean Ġ= ĠSimple Trigger Factory Bean () ĊĠĠĠĠĠĠĠ Ġfactory Bean . setName ( trigger Name ) ĊĠĠĠĠĠĠĠ Ġfactory Bean . set StartTime ( startTime ) ĊĠĠĠĠĠĠĠ Ġfactory Bean . set Repeat Interval ( repeat Time ) ĊĠĠĠĠĠĠĠ Ġfactory Bean . set Repeat Count ( Simple Trigger . REPEAT _ IN DEF INIT ELY ) ĊĠĠĠĠĠĠĠ Ġfactory Bean . set Mis fire Instruction ( mis Fire Instruction ) ĊĠĠĠĠĠĠĠ Ġfactory Bean . after Properties Set () ĊĠĠĠĠĠĠĠ Ġreturn Ġfactory Bean . getObject () ĊĠĠĠ Ġ} Ċ }