/** * Register objects in the JobDataMap via a given Map. * <p>These objects will be available to this Job only, * in contrast to objects in the SchedulerContext. * <p>Note: When using persistent Jobs whose JobDetail will be kept in the * database, do not put Spring-managed beans or an ApplicationContext * reference into the JobDataMap but rather into the SchedulerContext. * @param jobDataAsMap a Map with String keys and any objects as values * (for example Spring-managed beans) * @see org.springframework.scheduling.quartz.SchedulerFactoryBean#setSchedulerContextAsMap */ public void setJobDataAsMap(Map<String, ?> jobDataAsMap) { getJobDataMap().putAll(jobDataAsMap); }
/** * Register objects in the JobDataMap via a given Map. * <p>These objects will be available to this Job only, * in contrast to objects in the SchedulerContext. * <p>Note: When using persistent Jobs whose JobDetail will be kept in the * database, do not put Spring-managed beans or an ApplicationContext * reference into the JobDataMap but rather into the SchedulerContext. * @param jobDataAsMap a Map with String keys and any objects as values * (for example Spring-managed beans) * @see org.springframework.scheduling.quartz.SchedulerFactoryBean#setSchedulerContextAsMap */ public void setJobDataAsMap(Map<String, ?> jobDataAsMap) { getJobDataMap().putAll(jobDataAsMap); }
@Override public void afterPropertiesSet() { Assert.notNull(this.jobClass, "Property 'jobClass' is required"); if (this.name == null) { this.name = this.beanName; } if (this.group == null) { this.group = Scheduler.DEFAULT_GROUP; } if (this.applicationContextJobDataKey != null) { if (this.applicationContext == null) { throw new IllegalStateException( "JobDetailBean needs to be set up in an ApplicationContext " + "to be able to handle an 'applicationContextJobDataKey'"); } getJobDataMap().put(this.applicationContextJobDataKey, this.applicationContext); } JobDetailImpl jdi = new JobDetailImpl(); jdi.setName(this.name != null ? this.name : toString()); jdi.setGroup(this.group); jdi.setJobClass(this.jobClass); jdi.setJobDataMap(this.jobDataMap); jdi.setDurability(this.durability); jdi.setRequestsRecovery(this.requestsRecovery); jdi.setDescription(this.description); this.jobDetail = jdi; }
@Override public void afterPropertiesSet() { Assert.notNull(this.jobClass, "Property 'jobClass' is required"); if (this.name == null) { this.name = this.beanName; } if (this.group == null) { this.group = Scheduler.DEFAULT_GROUP; } if (this.applicationContextJobDataKey != null) { if (this.applicationContext == null) { throw new IllegalStateException( "JobDetailBean needs to be set up in an ApplicationContext " + "to be able to handle an 'applicationContextJobDataKey'"); } getJobDataMap().put(this.applicationContextJobDataKey, this.applicationContext); } JobDetailImpl jdi = new JobDetailImpl(); jdi.setName(this.name != null ? this.name : toString()); jdi.setGroup(this.group); jdi.setJobClass(this.jobClass); jdi.setJobDataMap(this.jobDataMap); jdi.setDurability(this.durability); jdi.setRequestsRecovery(this.requestsRecovery); jdi.setDescription(this.description); this.jobDetail = jdi; }
/** * @see JobDetailFactoryBean#setJobDataAsMap(Map) * @param key * @param value * @return */ public QuartzJobBuilder addJobData(String key, Object value) { jobDetailFactoryBean.getJobDataMap().put(key, value); return this; } /**
/** * @see JobDetailFactoryBean#setJobDataAsMap(Map) * @param jobData * @return */ public QuartzJobBuilder putJobData(Map<String, ?> jobData) { if (null != jobData) { jobDetailFactoryBean.getJobDataMap().putAll(jobData); } return this; } /**