Class CalendarSubscriptionRefreshJob
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 Summary
ConstructorsConstructorDescriptionCalendarSubscriptionRefreshJob(org.exoplatform.agenda.service.AgendaCalendarSubscriptionService subscriptionService, int batchSize) Builds the job. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanWhether the portal container is started and no HTTP connector is still starting.voidrefresh()Refreshes a batch of due subscriptions, once the server is up.
-
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 rulebatchSize- 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.@ContainerTransactionalestablishes 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
-