alxe1528

BlogJava 联系 聚合 管理
  3 Posts :: 11 Stories :: 2 Comments :: 0 Trackbacks
<bean id="taskExecutor"
        class="org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor">
        <property name="corePoolSize" value="5" />
        <property name="maxPoolSize" value="15" />
        <property name="queueCapacity" value="25" />
    </bean>

    <bean id="companyTimeTaskExecutorQueueConsumer"
        class="cn.sh.online.comment.util.timer.CompanyTimeTaskExecutorQueueConsumer">
        <constructor-arg ref="taskExecutor" />
        <constructor-arg ref="commentContentService" />
        <constructor-arg ref="timerIpFilter" />
        <constructor-arg ref="timerKeywordFilter" />
        <constructor-arg ref="timerBlackNameFilter" />
    </bean>


    <bean id="restTimeTaskExecutorQueueConsumer"
        class="cn.sh.online.comment.util.timer.RestTimeTaskExecutorQueueConsumer">
        <constructor-arg ref="taskExecutor" />
        <constructor-arg ref="commentContentService" />
        <constructor-arg ref="timerIpFilter" />
        <constructor-arg ref="timerKeywordFilter" />
        <constructor-arg ref="timerBlackNameFilter" />
    </bean>

    <bean id="companyTimeJob"
        class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        <property name="targetObject">
            <ref bean="companyTimeTaskExecutorQueueConsumer" />
        </property>
        <property name="targetMethod">
            <value>eatCommentContentFrontDto</value>
        </property>
    </bean>

    <bean id="restTimeJob"
        class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
        <property name="targetObject">
            <ref bean="restTimeTaskExecutorQueueConsumer" />
        </property>
        <property name="targetMethod">
            <value>eatCommentContentFrontDto</value>
        </property>
    </bean>

    <bean id="companyTimeCron"
        class="org.springframework.scheduling.quartz.CronTriggerBean">
        <property name="jobDetail">
            <ref bean="companyTimeJob" />
        </property>
        <property name="cronexpression_r_r">
            <value>*/5 * 0-7 * * ?</value>
        </property>
    </bean>


    <bean id="restTimeCron"
        class="org.springframework.scheduling.quartz.CronTriggerBean">
        <property name="jobDetail">
            <ref bean="restTimeJob" />
        </property>
        <property name="cronexpression_r_r">
            <value>*/5 * 8-17 * * ?</value>
        </property>
    </bean>

    <bean autowire="no"
        class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
        <property name="triggers">
            <list>
                <ref local="companyTimeCron" />
                <ref local="restTimeCron" />
            </list>
        </property>
    </bean>
posted on 2012-01-02 11:57 郑健成 阅读(460) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: