spring 定时任务
来源:互联网 发布:热场模拟软件 编辑:程序博客网 时间:2024/06/06 10:55
1:job
spring context 配置文件
task timer配置文件:
- @Component("apiWorker")
- public class ApiWorker
@Component("apiWorker")public class ApiWorker
spring context 配置文件
- <?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:task="http://www.springframework.org/schema/task"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd
- http://www.springframework.org/schema/task
- http://www.springframework.org/schema/task/spring-task-3.0.xsd">
- <!--<bean id="javaMailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">-->
- <!--<property name="host" value="192.168.95.47"/>-->
- <!--<property name="username" value="sohuopen@xxxx.com"/>-->
- <!--<property name="defaultEncoding" value="utf-8"></property>-->
- <!--<property name="javaMailProperties">-->
- <!--<props>-->
- <!--<prop key="mail.debug">false</prop>-->
- <!--</props>-->
- <!--</property>-->
- <!--</bean>-->
- <context:component-scan base-package="com.sohu.twitter"/>
- <task:annotation-driven/>
- <import resource="classpath:open-dao-beans.xml"/>
- </beans>
<?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:task="http://www.springframework.org/schema/task" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd"> <!--<bean id="javaMailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">--> <!--<property name="host" value="192.168.95.47"/>--> <!--<property name="username" value="sohuopen@xxxx.com"/>--> <!--<property name="defaultEncoding" value="utf-8"></property>--> <!--<property name="javaMailProperties">--> <!--<props>--> <!--<prop key="mail.debug">false</prop>--> <!--</props>--> <!--</property>--> <!--</bean>--> <context:component-scan base-package="com.sohu.twitter"/> <task:annotation-driven/> <import resource="classpath:open-dao-beans.xml"/></beans>
task timer配置文件:
- <?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:aop="http://www.springframework.org/schema/aop"
- xmlns:task="http://www.springframework.org/schema/task"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-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/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
- http://www.springframework.org/schema/task
- http://www.springframework.org/schema/task/spring-task-3.0.xsd">
- <task:scheduled-tasks>
- <task:scheduled ref="apiWorker" method="doWork" cron="0 30 5 * * ?"/>
- </task:scheduled-tasks>
- <import resource="classpath:applicationContext-open-core.xml"/>
- </beans>
- Spring计划任务(定时任务)
- Spring 定时任务功能
- Spring 定时任务实现
- spring执行定时任务
- spring执行定时任务
- spring中的定时任务
- spring多定时任务
- Spring+Quartz定时任务
- spring的定时任务
- spring 定时任务
- Spring 定时任务功能
- spring多任务定时
- spring quartz 定时任务
- Spring-quartz定时任务
- spring中的定时任务
- Spring 定时任务
- spring 定时任务 quartz
- spring定时任务
- ajax乱码解决总结
- 2013年我的JAVA开始
- eclipse启动tomcat出现内存溢出错误 java.lang.OutOfMemoryError: PermGen space
- Ogre4J 使用中错误总结
- JAVA程序性能分析及调优浅析
- spring 定时任务
- 开源 免费 java CMS - FreeCMS-标签 link .
- 封装Hibernate对数据库的操作,包括: 添加,删除,修改,加载,查询,分页查询,命名查询
- 开源 免费 java CMS - FreeCMS-标签 linkClass .
- 深入浅出Zookeeper之四Create请求和处理
- maven出现(请使用-source 5 或者更高版本以启用XX)问题解决
- spring mvc3中的addFlashAttribute方法
- 初识C#
- [WPF基础入门][3]__基元素