为程序猿打造的最专业的问答平台
我要提问官方QQ群:367722569

谁用过Quartz定时器,麻烦大神帮看下,要疯了,这个错弄两天没解决Spring

浏览1388 | 李勇 发布于 3年前 | | 举报
软件版本:springmvc

20170602095715_626.png


<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:cache="http://www.springframework.org/schema/cache" xmlns:context="http://www.springframework.org/schema/context" xmlns:task="http://www.springframework.org/schema/task" xsi:schemalocation="http://www.springframework.org/schema/beans
                        http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
                        http://www.springframework.org/schema/mvc
                         http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
                          http://www.springframework.org/schema/cache
                        http://www.springframework.org/schema/cache/spring-cache-3.2.xsd
                        http://www.springframework.org/schema/context
                        http://www.springframework.org/schema/context/spring-context-3.1.xsd
                         http://www.springframework.org/schema/task
                         http://www.springframework.org/schema/task/spring-task-3.0.xsd
                         http://www.springframework.org/schema/mvc
                         http://www.springframework.org/schema/mvc/spring-mvc.xsd "> 
 <!-- 1 --> 
 <context:component-scan base-package="util" /> 
 <!-- 2 --> 
 <task:scheduler id="scheduler" pool-size="10" /> 
 <task:executor id="executor" keep-alive="3600" pool-size="100-200" queue-capacity="500" rejection-policy="CALLER_RUNS" /> 
 <task:annotation-driven executor="executor" scheduler="scheduler" /> 
 <!-- 3 --> 
 <bean id="myJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean"> 
  <property name="Durability" value="true" /> 
  <property name="jobClass" value="util.CallGirl" /> 
 </bean> 
 <!-- 4 -->pp 
 <bean id="myTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean"> 
  <property name="jobDetail" ref="myJob" /> 
  <property name="startDelay" value="2000" /> 
  <property name="repeatInterval" value="5000" /> 
 </bean> 
 <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> 
  <property name="triggers"> 
   <list> 
    <ref bean="myTrigger" /> 
    <!-- <ref bean="cronTrigger"/> --> 
   </list> 
  </property> 
 </bean> 
</beans>

0个回答
我来回答
您当前输入了 0 个文字

擅长用户

kkli ooxxPP 野夫 程序员1999 老白菜 路俊建 herostark 开发陈 豆啊豆啊豆豆 橙寒羽 御宅小受
TOP
登录
登录
记住我
忘记密码?
密码错误
登陆
没有账号?点此注册
举报
胡乱举报将扣除一定问答币或以其他方式进行处罚
辱骂 广告 重复 其他
举报