home personal workZone travel about
code.pst » tech musings and code posts

Injecting beans into Quartz job

Finally as promised the revised and more efficient way to inject beans directly into your quartz jobs. Simply use the jobDataAsMap property.

<bean name="jobBean" class="org.springframework.scheduling.quartz.JobDetailBean">
		<property name="jobClass" value="com.irahul.example.SpringQuartzJob" />	  
	  	<property name="name" value="jobName" />
	  	<property name="jobDataAsMap">
			<map>
				<entry key="setterName" value-ref="beanRef" />				
                                .....
			</map>
		</property>
	</bean>

Tags: ,

Comments are closed.