61 lines
2.3 KiB
XML
61 lines
2.3 KiB
XML
<?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:context="http://www.springframework.org/schema/context"
|
|
xmlns:tx="http://www.springframework.org/schema/tx"
|
|
xmlns:aop="http://www.springframework.org/schema/aop"
|
|
xsi:schemaLocation="
|
|
http://www.springframework.org/schema/beans
|
|
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
|
http://www.springframework.org/schema/context
|
|
http://www.springframework.org/schema/context/spring-context-3.0.xsd
|
|
http://www.springframework.org/schema/tx
|
|
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
|
|
http://www.springframework.org/schema/aop
|
|
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
|
|
">
|
|
|
|
<!--扫描加注解功能 -->
|
|
<context:component-scan base-package="com.we3e" />
|
|
|
|
<!-- 定式任务 -->
|
|
|
|
<!-- 启动触发器的配置开始 -->
|
|
<bean name="startQuertz" lazy-init="false" autowire="no" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
|
|
<property name="triggers">
|
|
<list>
|
|
<ref bean="PushTrigger" />
|
|
</list>
|
|
</property>
|
|
</bean>
|
|
<!-- 启动触发器的配置结束 -->
|
|
|
|
<!-- 调度的配置开始 -->
|
|
<!-- quartz-2.x的配置 -->
|
|
<bean id="PushTrigger"
|
|
class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
|
|
<property name="jobDetail">
|
|
<ref bean="pushDetail" />
|
|
</property>
|
|
<property name="cronExpression">
|
|
<!-- s m h d m w(?) y(?) 秒>分>小时>日>月>周>年-->
|
|
<value>0 0/30 6-22 * * ?</value>
|
|
</property>
|
|
</bean>
|
|
<!-- 调度的配置结束 -->
|
|
|
|
<!-- job的配置开始 -->
|
|
<bean id="pushDetail"
|
|
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
|
|
<property name="targetObject">
|
|
<ref bean="pushService" />
|
|
</property>
|
|
<property name="targetMethod">
|
|
<value>push</value>
|
|
</property>
|
|
</bean>
|
|
<!-- job的配置结束 -->
|
|
|
|
<!-- 工作的bean -->
|
|
<bean id="pushService" class="com.we3e.service.impl.PushServiceImpl" />
|
|
</beans> |