You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Ashish Chopra (JIRA)" <ji...@apache.org> on 2018/08/09 19:15:00 UTC
[jira] [Created] (SLING-7820) Scheduler's WhiteboardHandler impl
not in sync with Scheduler's Javadoc
Ashish Chopra created SLING-7820:
------------------------------------
Summary: Scheduler's WhiteboardHandler impl not in sync with Scheduler's Javadoc
Key: SLING-7820
URL: https://issues.apache.org/jira/browse/SLING-7820
Project: Sling
Issue Type: Bug
Components: Commons
Affects Versions: Commons Scheduler 2.7.2
Reporter: Ashish Chopra
Fix For: Commons Scheduler 2.7.2
[Sling Commons Scheduler's Javadoc|https://github.com/apache/sling-org-apache-sling-commons-scheduler/blob/d954255a750113c024a9323ed0d5d85d1ee69a5a/src/main/java/org/apache/sling/commons/scheduler/Scheduler.java#L26-L48] asserts that:
{quote} A job can be scheduled either by creating a {{ScheduleOptions}} instance through one of the scheduler methods and then calling {{schedule(Object, ScheduleOptions)}} or by using the whiteboard pattern and registering a Runnable service with either the {{PROPERTY_SCHEDULER_EXPRESSION}} or {{PROPERTY_SCHEDULER_PERIOD} property. *If both properties are specified, only {{PROPERTY_SCHEDULER_PERIOD}} is considered for scheduling.*{quote}
The part in *bold* above suggests that {{PROPERTY_SCHEDULER_PERIOD}} has a higher precedence than {{PROPERTY_SCHEDULER_EXPRESSION}} in case both are present for a component.
However, the implementation in [{{WhiteboardHandler#register}}|https://github.com/apache/sling-org-apache-sling-commons-scheduler/blame/d954255a750113c024a9323ed0d5d85d1ee69a5a/src/main/java/org/apache/sling/commons/scheduler/impl/WhiteboardHandler.java#L189] does the opposite. It gives {{PROPERTY_SCHEDULER_EXPRESSION}} a higher precedence by evaluating it first.
Either the Javadoc, or the implementation must be modified to keep both in sync.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)