zoukankan      html  css  js  c++  java
  • spring-quartz.xml

     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     3     xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop"
     4     xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
     5     xsi:schemaLocation="http://www.springframework.org/schema/beans
     6        http://www.springframework.org/schema/beans/spring-beans.xsd
     7        http://www.springframework.org/schema/aop
     8        http://www.springframework.org/schema/aop/spring-aop.xsd
     9        http://www.springframework.org/schema/context
    10        http://www.springframework.org/schema/context/spring-context.xsd
    11        http://www.springframework.org/schema/tx
    12        http://www.springframework.org/schema/tx/spring-tx.xsd">
    13     
    14 
    15 
    16     <!--配置清空MAP的作业类  -->
    17      <bean id="testQuartz"
    18         class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
    19         <property name="targetObject">
    20             <bean class="com.pda.quartz.JobTest" />
    21         </property>
    22         <property name="targetMethod" value="test" />
    23     </bean>
    24     
    25     
    26       <!-- targetObject:指定包含任务执行体的Bean实例。
    27       targetMethod:指定将指定Bean实例的该方法包装成任务的执行体。 -->
    28       
    29       
    30     <!-- 配置清空MAP的触发方式 -->
    31     <bean id="testTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
    32         <property name="jobDetail" ref="testQuartz" />
    33         <property name="cronExpression" value="0 */1 * * * ?" />
    34     </bean>
    35     
    36     <!-- 配置调度工厂  -->
    37     <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="false">
    38         <property name="triggers">
    39             <list>                
    40                 <!-- 清空MAP调度 -->
    41                 <ref bean="testTrigger"/>
    42             </list>
    43         </property>
    44     </bean> 
    45     
    46     
    47 </beans>
     1 package com.pda.quartz;
     2 
     3 
     4 public class JobTest {
     5     
     6     public void test() {
     7         
     8         System.out.println("hhhh");
     9         
    10     }
    11 
    12 }
    抱怨没有用,只能靠自己
  • 相关阅读:
    刷题-力扣-541. 反转字符串 II
    刷题-力扣-515. 在每个树行中找最大值
    刷题-力扣-513. 找树左下角的值
    刷题-力扣-404. 左叶子之和
    刷题-力扣-257. 二叉树的所有路径
    刷题-力扣-226. 翻转二叉树
    刷题-力扣-236. 二叉树的最近公共祖先
    刷题-力扣-235. 二叉搜索树的最近公共祖先
    刷题-力扣-145. 二叉树的后序遍历
    扛把子组2018092609-2 选题 Scrum立会报告+燃尽图 06
  • 原文地址:https://www.cnblogs.com/mybatis/p/5912101.html
Copyright © 2011-2022 走看看