Scheduler

The scheduler is currently based on Quartz, whereas it is turned off by default. In order to enable it, one has to set

<scheduler enabled="true"/>
inside the Yanel configuration yanel.xml

One can configure jobs per realm (e.g. src/realms/from-scratch-realm-template/data-repo/data/scheduler-jobs.xml), whereas the configuration is read during startup. An example can be found below:

<?xml version="1.0"?>

<scheduler xmlns="http://www.wyona.org/scheduler/1.0">
  <jobs enabled="true">
    <job class="org.wyona.yanel.servlet.HeartbeatJob" name="hearbeat1">
      <!--<trigger startDate="2012.01.16T23:30:15">--> <!-- Date format: "yyyy.MM.dd'T'HH:mm:ss" -->
      <trigger startDate="NOW">
        <!--<repeat count="REPEAT_INDEFINITELY" interval="60000"/>-->
        <repeat count="3" interval="60000"/>
      </trigger>
    </job>
  </jobs>
</scheduler>

In case you want to prevent that the same job is running concurrently multiple times, for example because the interval is configured shorter than it takes to complete the job, then you might want to implement StatefulJob instead Job.



Your comments are much appreciated

Is the content of this page unclear or you think it could be improved? Please add a comment and we will try to improve it accordingly.