@Bean public JobDetailFactoryBean process() { JobDetailFactoryBean jobDetailFactory = new JobDetailFactoryBean(); jobDetailFactory.setJobClass(FooJob.class); jobDetailFactory.setDurability(true); return jobDetailFactory; }
@Bean public JobDetailFactoryBean jobDetailFactoryBean() { JobDetailFactoryBean factory = new JobDetailFactoryBean(); factory.setJobClass(ScheduleJob.class); Map<String, Object> map = new HashMap<String, Object>(); map.put("status", Status.DONE); factory.setJobDataAsMap(map); factory.setGroup("schedule"); factory.setName("deleteAllByStatus"); return factory; }
@Bean public JobDetailFactoryBean jobDetailFactoryBean() { JobDetailFactoryBean factory = new JobDetailFactoryBean(); factory.setJobClass(MyJobTwo.class); Map<String, Object> map = new HashMap<String, Object>(); map.put("name", "RAM"); map.put(MyJobTwo.COUNT, 1); factory.setJobDataAsMap(map); factory.setGroup("mygroup"); factory.setName("myjob"); return factory; }