Hi,
I've got a request scoped bean that I would like to use inside of a quartz job. I realize that I would not have access to the request objects, which is fine. To run Junit tests on my beans, I already declare custom scopes using:
Is there anyway I can inject a similar scope configurer into a bean used as a quartz job? My Job is currently defined as:Code:<bean class="org.springframework.beans.factory.config.CustomScopeConfigurer"> <property name="scopes"> <map> <entry key="request"> <bean class="org.springframework.context.support.SimpleThreadScope" /> </entry> </map> </property> </bean>
Thanks!Code:<bean id="fwl.service.TrendLeaderArticleService.trigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="cronExpression" value="0/30 * * * * ? *" /> <property name="jobDetail"> <bean class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="name" value="fwl.service.TrendLeaderArticleService" /> <property name="group" value="news" /> <property name="targetObject" ref="trendLeaderArticleServiceImpl"/> <property name="targetMethod" value="createTrendLeaderArticle"/> <property name="concurrent" value="false" /> </bean> </property> </bean>
Eric


Reply With Quote
