使用struts2

时间:2018-11-10 07:27:55

标签: quartz-scheduler

我正在将struts-spring插件用于夸脱调度程序。因此,有用于调度程序的application-context-scheduler.xml文件。现在我们有了用于生产的集群环境。我正在搜索这个问题,但是大多数示例都在谈论quarts.properties文件,该文件在Tomcat或其他服务器中具有数据源的配置。有人可以帮我解决这个问题。

示例xml文件。

<beans>
                     <!--Scheduler task for Before Due Date -->
                   <bean  name="scTask" class="com.abc.scheduler.ScTask" >
                        <constructor-arg ref="scServ" />
                   </bean>

                   <!-- Scheduler job  --> 
                   <bean name="schedulerJob"
                       class=               
     "org.springframework.scheduling.quartz.JobDetailBean">

                     <property name="jobClass" 
      value="com.abc.scheduler.ScJob" />

                     <property name="jobDataAsMap">
                        <map>
                          <entry key="scTsk" value-ref="scTask" />
                         </map>
                      </property>
                   </bean>

                    <!-- Cron Trigger --> 
                   <bean id="cronTrigger"

           class="org.springframework.scheduling.quartz.CronTriggerBean">

                    <property name="jobDetail" ref="scJob" />
                    <property name="cronExpression" value="0 0/50 * * * ?" />

                   </bean>

                    <!-- Scheduler --> 
                   <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
                    <property name="jobDetails">
                       <list>
                          <ref bean="scJob" />
                       </list>
                    </property>

                    <property name="triggers">
                        <list>
                        <ref bean="cronTrigger" />
                        </list>
                    </property>
                   </bean>


                </beans>    

<beans> <!--Scheduler task for Before Due Date --> <bean name="scTask" class="com.abc.scheduler.ScTask" > <constructor-arg ref="scServ" /> </bean> <!-- Scheduler job --> <bean name="schedulerJob" class= "org.springframework.scheduling.quartz.JobDetailBean"> <property name="jobClass" value="com.abc.scheduler.ScJob" /> <property name="jobDataAsMap"> <map> <entry key="scTsk" value-ref="scTask" /> </map> </property> </bean> <!-- Cron Trigger --> <bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="scJob" /> <property name="cronExpression" value="0 0/50 * * * ?" /> </bean> <!-- Scheduler --> <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="jobDetails"> <list> <ref bean="scJob" /> </list> </property> <property name="triggers"> <list> <ref bean="cronTrigger" /> </list> </property> </bean> </beans>

0 个答案:

没有答案