I wrote my job using jsr-352 and deployed it on wildfly. How can I schedule one job with some delay after last end time like below time line where =
is execution time and -
is delay time:
===============--=====--========--
Note: maximum number of job execution is one
JBeret ejb scheduler supports repeating interval job executions, with a fixed interval duration or certain delay duration after the start of job execution. Delay after end of a job execution is currently not supported. If your job execution duration is relatively predictable, you can approximate it with either interval or delay after the start of a job execution.
To achieve this kind of job schedulgin with finer control, you can try the following:
afterJob()
method should be able to look up or injectTimerSchedulerBean
, which is a local singleton EJB, and invoke itsorg.jberet.schedule.TimerSchedulerBean#schedule
method. The job listener is reponsible for creating an instance oforg.jberet.schedule.JobScheduleConfig
, passing it when calling the ejb business method. The job listener should already have all info to createJobScheduleConfig
.