Hello World
Java技术学习
posts - 17,  comments - 7,  trackbacks - 0
spring的quartz配置
<bean id="sendJobDetail" 
        class
="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        
<property name="targetObject" ref="smsService"/>
        
<property name="targetMethod" value="sendAllUnsentMessage"/>
    
</bean>
    
<bean id="monitorJobDetail" 
        class
="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        
<property name="targetObject" ref="smsClientMonitor"/>
        
<property name="targetMethod" value="monitor"/>
    
</bean>
    
<bean id="sendTrigger" 
        class
="org.springframework.scheduling.quartz.SimpleTriggerBean">
        
<property name="jobDetail" ref="sendJobDetail"/>
        
<property name="startDelay" value="${sendTrigger.startDelay}"/>
        
<property name="repeatInterval" value="${sendTrigger.repeatInterval}"/>
    
</bean>
    
<bean id="monitorTrigger" 
        class
="org.springframework.scheduling.quartz.CronTriggerBean">
        
<property name="jobDetail" ref="monitorJobDetail"/>
        
<property name="cronExpression" 
            value
="${monitorTrigger.cronExpression}"/>
    
</bean>
    
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
        
<property name="triggers">
            
<list>
                
<ref bean="sendTrigger"/>
                
<ref bean="monitorTrigger"/>
            
</list>
        
</property>
    
</bean>
posted on 2006-11-17 11:12 Java初心 阅读(401) 评论(0)  编辑  收藏 所属分类: Spring

只有注册用户登录后才能发表评论。


网站导航:
 

<2024年11月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

常用链接

留言簿(1)

随笔分类

随笔档案

文章分类

文章档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜