GithubHelp home page GithubHelp logo

quartz's Introduction

Quartz

<!--     ****************************************配置跑批**************************************-->
        <!-- 线程执行器配置,用于任务注册 --> 
 <bean id="executor" class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">  
 <property name="corePoolSize" value="10" />  
 <property name="maxPoolSize" value="100" />  
 <property name="queueCapacity" value="500" />  
</bean>  
 <bean id="articleBatchRun" class="top.wys.developerclub.batchprocess.ArticleBatchRun" />
 
 <!-- ============= 调度业务=============  -->
<bean id="articleBatchRunService" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
    <!-- 要调用的对象 -->
    <property name="targetObject" ref="articleBatchRun" />
    <!-- 要执行的方法名称 -->
    <property name="targetMethod" value="count" />
    <!-- 如果前一个任务还没有结束第二个任务不会启动 false -->
    <property name="concurrent" value="false" />
</bean>
 
 
<!-- ============= 调度触发器 ============= -->
<bean id="articleBatchRunTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
    <property name="jobDetail" ref="articleBatchRunService" />
                        <!-- 每隔3秒钟审批一次 -->
    <property name="cronExpression" value="0/3 * * * * ?" />
</bean>
 
<!-- ============= 调度工厂 =============  -->
<bean id="schedulerBean" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="false">
    <property name="triggers">
        <list>
            <!-- add by 郑明亮 2017年2月12日19:58:13 用于定时爬取文章 -->
          <ref bean="articleBatchRunTrigger"/> 
         
        </list>
    </property>
</bean>

quartz's People

Contributors

codefiveminutesdebugtwohours avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.