I know that is possible to schedule a task using the timer service that will run every N seconds. One of the ways to do this , is described here : https://docs.oracle.com/javaee/6/api/javax/ejb/ScheduleExpression.html under the section Increments
But the thing is : For the second and minute attributes, x and y must each be in the range [0,59]
But what I'm after is to schedule a task to run every 90 seconds. Is it possible with TimerService of EJB? First I thought it would work with something like that: second=*/30 , minute=*/1 but it did not. Checked the docs again which makes it more clear :
every N seconds, minutes, or hours within the minute, hour, or day, respectively
Or as another example :
Example: second = "30/10" (Every 10 seconds within the minute, starting at second 30) This is equivalent to: second = "30,40,50"
Note that the set of matching increment values stops once the maximum value for that attribute is exceeded. It does not "roll over" past the boundary.
Example : ( minute = "∗/14", hour="1,2")
This is equivalent to: (minute = "0,14,28,42,56", hour = "1,2") (Every 14 minutes within the hour, for the hours of 1 and 2 a.m.)
So is it possible to achieve the 90 seconds interval in any way?
Use an interval timer instead of the calendar one. Check EJB TimerService createTimer methods
int intervalMillis = 90*1000; // milliseconds
timerService.createTimer(intervalMillis, intervalMillis, <info instance>);