Class CalendarSubscriptionRefreshJob

java.lang.Object
org.exoplatform.agenda.job.CalendarSubscriptionRefreshJob

@Component public class CalendarSubscriptionRefreshJob extends Object
Refreshes the calendar subscriptions whose refresh is due (EXO-90278).

Every node fires it. Spring's scheduler is node-local on this platform — there is no clustered TaskScheduler — so the job holds no logic and no lock of its own: the service claims each subscription in the database before reading its feed, and a node that loses the claim moves on.

Not before the server is up. A run finding the portal container not started, or the HTTP connector not started yet, does nothing: the kernel's ServerStartupWaiter is asked, without waiting, and the next run tries again.

The cron is exo.agenda.calendarSubscription.refresh.cron, every ten minutes by default; - turns the job off, and subscriptions are then refreshed only when their owner asks.

  • Constructor Details

    • CalendarSubscriptionRefreshJob

      @Autowired public CalendarSubscriptionRefreshJob(org.exoplatform.agenda.service.AgendaCalendarSubscriptionService subscriptionService, @Value("${exo.agenda.calendarSubscription.refresh.batchSize:20}") int batchSize)
      Builds the job.
      Parameters:
      subscriptionService - the service holding every refresh rule
      batchSize - most subscriptions refreshed by one run of one node
  • Method Details

    • refresh

      @Scheduled(cron="${exo.agenda.calendarSubscription.refresh.cron:0 */10 * * * ?}") public void refresh()
      Refreshes a batch of due subscriptions, once the server is up.

      @ContainerTransactional establishes the portal container on the scheduler's thread, which has none bound.

    • isServerStarted

      protected boolean isServerStarted()
      Whether the portal container is started and no HTTP connector is still starting.
      Returns:
      true when a refresh may run