jsr236-experts@concurrency-ee-spec.java.net

[jsr236-experts] How to indicate no more task executions for a Trigger

From: Nathan Rauh <naterauh_at_us.ibm.com>
Date: Thu, 11 Jul 2013 15:44:10 -0500

We noticed that the spec/JavaDoc isn't clear on how a Trigger should go
about indicating there should be no more executions of a task.
It can be inferred that if Trigger.getNextRunTime were to raise an error,
then there could not be any more executions, and that it could make sense
in response for Future.get to then raise AbortedException chaining that
error.
However, that isn't a very clean way to indicate no more executions. The
spec/JavaDoc is silent on what it means for Trigger.getNextRunTime to
return null, and it could also make sense for that to indicate there
should be no more executions. In that case, we are wondering what
Future.get ought to return. I'd like to say it should return the result
of the final execution. However, the ManagedScheduledExecutorService
JavaDoc states that "Future and past executions of the task are not
represented by the Future." How does everyone else see this? Is it
acceptable for Future.get to continue to return the result of the final
execution, or is that considered a "past execution" and thus disallowed by
the spec, in which case an error would need to be raised (maybe
AbortedException?)

Nathan Rauh
____________________________________________
Software Engineer, WebSphere Application Server
IBM Rochester Bldg 030-2 C310
3605 Highway 52N
Rochester, MN 55901-7802