English 中文(简体)
JBos 5 安排背景任务。 相互执行后中断时间表
原标题:JBoss 5 scheduling background tasks. Executed one after another which breaks the schedule

例如,我有两个任务:

  <mbean code="org.jboss.varia.scheduler.Scheduler" name=":service=Scheduler">
    <attribute name="StartAtStartup">true</attribute>
    <attribute name="SchedulableClass">Scheduler1</attribute>
    <attribute name="InitialStartDate">NOW</attribute>
    <attribute name="SchedulePeriod">60</attribute>
    <attribute name="InitialRepetitions">-1</attribute>
    <attribute name="FixedRate">false</attribute>
  </mbean>

  <mbean code="org.jboss.varia.scheduler.Scheduler" name=":service=Scheduler2">
    <attribute name="StartAtStartup">true</attribute>
    <attribute name="SchedulableClass">Scheduler2</attribute>
    <attribute name="InitialStartDate">NOW</attribute>
    <attribute name="SchedulePeriod">3600</attribute>
    <attribute name="InitialRepetitions">-1</attribute>
    <attribute name="FixedRate">false</attribute>
  </mbean>

I.e. 首先安排每分钟,每小时二次。

问题在于,如果执行第二个任务需要5分钟,那么第一个任务在此时就没有执行,而是等待第二个任务完成。

是否有办法让他们同时工作? 或者,我应该移到Quartz或其它东西?

最佳回答

用途

<attribute name="TimerName">jboss:service=TimerNew</attribute>

它将开始按班轮安排。

问题回答

暂无回答




相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签