[jboss-jira] [JBoss JIRA] (WFLY-4558) Use "increment" @Schedule for minute require specify hour, for second require specify hour and minute
Matteo Mortari (JIRA)
issues at jboss.org
Mon Apr 27 04:18:52 EDT 2015
[ https://issues.jboss.org/browse/WFLY-4558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13062704#comment-13062704 ]
Matteo Mortari commented on WFLY-4558:
--------------------------------------
Hi [~swd847], thank you for the feedback, but I beg to disagree.
I believe the default "0" is there to support a "none-specified" use case for +all+ fields, mentioned at the beginning of that Javadoc:
{quote}
All elements of this annotation are optional. +If none are specified+ a persistent timer will be created with callbacks occuring every day +at midnight+ in the default time zone associated with the container in which the application is executing.
{quote}
At least this is my perspective, and supporting reason why it would not be going against the specs overriding the default for {{hour}}, {{minute}}, in the case where the "increments" expression is used.
While I kindly ask you to reconsider this ticket rejection, I agree (as I've mentioned in the first place) this has a trivial workaround, so I hope at least was worthy to report as a JIRA record for posterity.
Thanks again,
Ciao
MM
> Use "increment" @Schedule for minute require specify hour, for second require specify hour and minute
> -----------------------------------------------------------------------------------------------------
>
> Key: WFLY-4558
> URL: https://issues.jboss.org/browse/WFLY-4558
> Project: WildFly
> Issue Type: Bug
> Components: EJB
> Affects Versions: 8.2.0.Final
> Reporter: Matteo Mortari
> Priority: Minor
> Attachments: 20150425.WFLY-4558.zip
>
>
> I will attach reproducer and from my perspective workaround exists.
> If I {{@Schedule}} like this
> {code}
> @Schedule(minute="*/1", persistent=false) // NOT working.
> {code}
> is not working.
> But if I do like this:
> {code}
> @Schedule(hour="*", minute="*/1", persistent=false) // this works OK.
> {code}
> it works.
> In the specs (1) there is no mention that if I schedule using "Increments" option do I need to specify any of the other elements, because in general _All elements of this annotation are optional._
> The problem is applying analogously if using "Increments" option for the {{second}} element, you need to specifiy {{hour}} and {{minute}} to have it working.
> So, while I anyway in my perspective workaround exists - specify star {{"*"}} for hour or minute-and-hour for setting increments at minute or second respectively - I believe this behavior was not fully adherent to the specs and worth notifying, also I've taken liberty not to leave this jira priority as high, which was by default =)
> The attached reproducer should be self-explanatory, the most important is the EJB being scheduled:
> {code}
> @Schedule(minute="*/1", persistent=false)
> public void settingJustMinute() {
> LOG.info("settingJustMinute() : invoked."); // NOT working
> }
> @Schedule(hour="*", minute="*/1", persistent=false)
> public void settingEveryMinuteStarHour() {
> LOG.info("settingEveryMinuteStarHour() : invoked."); // is working OK.
> }
> @Schedule(second="*/1", persistent=false)
> public void settingJustSecond() {
> LOG.info("settingJustSecond() : invoked."); // NOT working
> }
> @Schedule(minute="*", second="*/1", persistent=false)
> public void settingEverySecondStarMinute() {
> LOG.info("settingEverySecondStarMinute() : invoked."); // NOT working
> }
> @Schedule(hour="*", second="*/1", persistent=false)
> public void settingEverySecondStarHour() {
> LOG.info("settingEverySecondStarHour() : invoked."); // NOT working
> }
> @Schedule(hour="*", minute="*", second="*/1", persistent=false)
> public void settingEverySecondStarMinuteStarHour() {
> LOG.info("settingEverySecondStarMinuteStarHour() : invoked."); // is working OK.
> }
> {code}
> Hope this helps,
> Thank you
> Ciao
> (1) https://docs.oracle.com/javaee/7/api/javax/ejb/Schedule.html
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
More information about the jboss-jira
mailing list