首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 其他教程 > 开源软件 >

Spring 中Quartz 的配备样例

2013-01-08 
Spring 中Quartz 的配置样例?xml version1.0 encodingUTF-8?beans xmlnshttp://www.springfram

Spring 中Quartz 的配置样例
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd>
    <bean id="dataSource" value="com....job.TestBusinessQuartzJob"/>
  <property name="jobDataAsMap">
        <map>
            <entry key="serviceBean" value="TestJobBean1"/>
        </map>
    </property> 
</bean>
<bean id="TestJob2" value="com....job.TestBusinessQuartzJob"/>
  <property name="jobDataAsMap">
        <map>
            <entry key="serviceBean" value="TestJobBean2"/>
        </map>
    </property> 
</bean>

<!-- Trigger config -->
<bean id="TestTrigger1" value="0 0 * * * ?"/>
    </bean>
    <bean id="TestTrigger2" value="0 0 * * * ?"/>
    </bean>
  
<!-- Scheduler -->
<bean ref="dataSource"/>
<property name="taskExecutor" ref="taskExecutor"></property>
<property name="configLocation" value="WEB-INF/quartz.properties" />
<property name="schedulerContextAsMap">
    <map>
    <entry key="TestJobBean1"     value-ref="TestJobBean1"/>
    <entry key="TestJobBean2"     value-ref="TestJobBean2"/>
    </map>
    </property>  
</bean>

<!-- Workmanager, contain thread -->
<bean id="taskExecutor" value="wm/default"/>
   <property name="resourceRef" value="false"/>
</bean>
</beans>

热点排行