[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
Sat Apr 25 06:01:01 EDT 2015


Matteo Mortari created WFLY-4558:
------------------------------------

             Summary: 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


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