PUBLIC - Liferay Portal Community Edition
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-31466

It is possible to add multiple scheduler-entry with the same scheduler-event-listener-class, however it isn't working correctly.

    Details

    • Similar Issues:
      Show 5 results 

      Description

      Let's have more registered scheduler for one portlet for a portlet in a plugin with the same scheduler class (see below).

      1) The entries will be registered separately for the portlet, it's a list object. So theoretically it's possible to have the same scheduler class more times with different triggers. However, the job name and the group name for the trigger will be the SAME scheduler class name for all of the scheduler entries.

      2) During scheduling in the SchedulerEngineUtil class a SchedulerEventMessageListenerWrapper class will be instantiated and registered for all of the scheduler entries and a trigger will be created. It's fine.

      3) The trigger is identified by its group and job name and because of this the last trigger will be applied for all of the scheduler entries (with the same scheduler class).

      There is a workaround with using different scheduler classes, however, the separated scheduler entries should work independently from each other and it's possible to configure multiple scheduler-entry, but it's not working.

       1        <scheduler-entry>
       2            <scheduler-description>
       3                This scheduler is used to run my own job
       4            </scheduler-description>
       5            <scheduler-event-listener-class>com.portlet.test.trigger.MyScheduler</scheduler-event-listener-class>
       6            <trigger>
       7                <cron>
       8                    <cron-trigger-value>0/30 * * * * ?</cron-trigger-value>
       9                </cron>
      10            </trigger>
      11        </scheduler-entry> 
      12        <scheduler-entry>
      13            <scheduler-description>
      14                This scheduler is used to run my own job
      15            </scheduler-description>
      16            <scheduler-event-listener-class>com.portlet.test.trigger.MyScheduler</scheduler-event-listener-class>
      17            <trigger>
      18                <cron>
      19                    <cron-trigger-value>0/45 * * * * ?</cron-trigger-value>
      20                </cron>
      21            </trigger>
      22        </scheduler-entry>
      

        Issue Links

          Activity

          Hide
          Edward Gonzales added a comment -

          Hello everyone! We are in the process of removing component "Portlet" from LPS. Please make the necessary adjustments to affected filters. Thanks!

          Show
          Edward Gonzales added a comment - Hello everyone! We are in the process of removing component "Portlet" from LPS. Please make the necessary adjustments to affected filters. Thanks!
          Hide
          Tina Tian added a comment -

          Renata Kovacs Ivan Zaera
          I do not think we need this, I could not think up a sensible reason to do this. For the example you mentioned in description, you can conbine the two scheduler entries easily just by modifying the cron description.

          Show
          Tina Tian added a comment - Renata Kovacs Ivan Zaera I do not think we need this, I could not think up a sensible reason to do this. For the example you mentioned in description, you can conbine the two scheduler entries easily just by modifying the cron description.
          Hide
          Ivan Zaera added a comment -

          Tina Tian I agree with you that this is a corner case that may be easily worked around, but if we are not supporting this I guess we should, at least, warn the user of the duplication. Otherwise, the result is unpredictable and it can lead to a lot of wasted time until it is diagnosed. And we don't want to increase suffering in the world, do we? ;-P

          Show
          Ivan Zaera added a comment - Tina Tian I agree with you that this is a corner case that may be easily worked around, but if we are not supporting this I guess we should, at least, warn the user of the duplication. Otherwise, the result is unpredictable and it can lead to a lot of wasted time until it is diagnosed. And we don't want to increase suffering in the world, do we? ;-P

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Days since last comment:
                34 weeks, 2 days ago

                Development

                  Structure Helper Panel