@Override public void registerJobRunner(JobRunnerKey jobRunnerKey, JobRunner jobRunner) { delegate.registerJobRunner(jobRunnerKey, jobRunner); }
public JiraDirectoryPollerManager(final SchedulerService schedulerService) { this.schedulerService = schedulerService; this.schedulerService.registerJobRunner(JOB_RUNNER_KEY, new JiraDirectorySynchroniser()); }
@Override public void start() throws Exception { schedulerService.registerJobRunner(DELAYED_REPLICATION_KEY, new QueueDrainingJob()); schedulerService.registerJobRunner(FULL_REPLICATION_KEY, new FullReplicationJob()); }
public DefaultSubscriptionManager(final MailQueue mailQueue, final TemplateManager templateManager, final SubscriptionMailQueueItemFactory subscriptionMailQueueItemFactory, final ProjectRoleManager projectRoleManager, final GroupManager groupManager, SchedulerService schedulerService, final EntityEngine entityEngine) { super(templateManager, projectRoleManager); this.mailQueue = mailQueue; this.subscriptionMailQueueItemFactory = subscriptionMailQueueItemFactory; this.groupManager = groupManager; this.schedulerService = schedulerService; this.entityEngine = entityEngine; schedulerService.registerJobRunner(JobRunnerKey.of(JOB_RUNNER_KEY), new SendFilterJob()); }
public void start() throws Exception { eventPublisher.register(this); schedulerService.registerJobRunner(JOB_RUNNER_KEY, new DelayedUpgradeJobRunner(entityEngine, indexManager, clusterLockService, applicationProperties, reindexRequestManager, Integer.toString(upgradeConstraints.getTargetDatabaseBuildNumber()))); }
@Override public void afterPropertiesSet() throws Exception { schedulerService.registerJobRunner(CLEANUP_JOB_RUNNER_KEY, newCleanupTask()); // schedule the cleanup job once a day starting in a day schedulerService.scheduleJob(CLEANUP_JOB_ID, JobConfig.forJobRunnerKey(CLEANUP_JOB_RUNNER_KEY) .withSchedule(Schedule.forInterval(TimeUnit.DAYS.toMillis(1), DateTime.now().plusDays(1).toDate())) .withRunMode(RunMode.RUN_LOCALLY)); // cache dir is local to every application node }
@Override public void afterPropertiesSet() throws Exception { schedulerService.registerJobRunner(CLEANUP_JOB_RUNNER_KEY, newCleanupTask()); // schedule the cleanup job once a day starting in a day schedulerService.scheduleJob(CLEANUP_JOB_ID, JobConfig.forJobRunnerKey(CLEANUP_JOB_RUNNER_KEY) .withSchedule(Schedule.forInterval(TimeUnit.DAYS.toMillis(1), DateTime.now().plusDays(1).toDate())) .withRunMode(RunMode.RUN_LOCALLY)); // cache dir is local to every application node }
@Override public void onStart() { scheduler.registerJobRunner(JOB_RUNNER_KEY, this); try { scheduler.scheduleJob(JOB_ID, JobConfig.forJobRunnerKey(JOB_RUNNER_KEY) .withSchedule(getSchedule())); } catch (final SchedulerServiceException e) { log.error("Unable to schedule analytics job", e); } }
@Override public void onStart() { schedulerService.registerJobRunner(JOB_RUNNER_KEY, this); JobConfig config = JobConfig.forJobRunnerKey(JOB_RUNNER_KEY) .withRunMode(RUN_ONCE_PER_CLUSTER) .withSchedule(Schedule.forInterval(REMOVE_INTERVAL, new Date(System.currentTimeMillis() + REMOVE_INTERVAL))); try { schedulerService.scheduleJob(JobId.of(JOB_ID), config); } catch (SchedulerServiceException e) { log.error("Unable to schedule expired session remover job", e); } }
@Override public void onStart() { long intervalInMillis = configuration.getAlertTruncationInterval().toMillis(); long firstRunTime = System.currentTimeMillis() + intervalInMillis; schedulerService.registerJobRunner(JOB_RUNNER_KEY, new TruncateAlertsJobRunner()); try { schedulerService.scheduleJob(JOB_ID, JobConfig.forJobRunnerKey(JOB_RUNNER_KEY) .withSchedule(Schedule.forInterval(intervalInMillis, new Date(firstRunTime))) .withRunMode(RunMode.RUN_ONCE_PER_CLUSTER)); } catch (SchedulerServiceException e) { log.warn("Failed to schedule periodic alert truncation", e); } }
@Override public void start() throws Exception { final SchedulerService scheduler = ComponentAccessor.getComponent(SchedulerService.class); scheduler.registerJobRunner(JOB_RUNNER_KEY, this); // we need to scatter a bit sending events to analytics system, // lets not start this service on every instance in the same moment final Date firstRun = Date.from(Instant.now().plusMillis(random.nextLong() % FOUR_HOURS)); final JobConfig jobConfig = JobConfig.forJobRunnerKey(JOB_RUNNER_KEY) .withRunMode(RunMode.RUN_LOCALLY) .withSchedule(Schedule.forInterval(RUN_INTERVAL, firstRun)); scheduler.scheduleJob(JOB_ID, jobConfig); }
@Override public void start() { messagingService.registerListener(RESCHEDULE_SERVICE, messageConsumer); messagingService.registerListener(UNSCHEDULE_SERVICE, messageConsumer); schedulerService.registerJobRunner(SERVICE_JOB_KEY, new ServiceRunner()); ensureServicesScheduled(); }
@Test public void testSchedulerServiceJob() throws Exception { final CountDownLatch latch = new CountDownLatch(1); schedulerService.registerJobRunner(jobRunnerKey, new JobRunner() { @Nullable @Override public JobRunnerResponse runJob(JobRunnerRequest jobRunnerRequest) { latch.countDown(); return null; } }); final JobConfig jobConfig = JobConfig.forJobRunnerKey(jobRunnerKey) .withRunMode(RunMode.RUN_LOCALLY) .withSchedule(Schedule.runOnce(null)); try { schedulerService.scheduleJobWithGeneratedId(jobConfig); } catch (SchedulerServiceException sse) { throw new SchedulerRuntimeException(sse.getMessage(), sse); } assertThat(latch.await(30, TimeUnit.SECONDS), is(true)); }
unscheduleJob(jobKey); scheduler.unregisterJobRunner(jobRunnerKey); scheduler.registerJobRunner(jobRunnerKey, new JiraJobRunnerWrapper(jobDataMap, jobClass.getClassLoader())); final Schedule schedule = Schedule.forCronExpression(jobDataMap.get(CronScheduler.JOB_KEY_CRON_EXPRESSION).toString());
@EventListener public void onFrameworkStarted(PluginFrameworkStartedEvent event) { schedulerService.registerJobRunner(JOB_RUNNER_KEY, new AlertAnalyticsJobRunner()); try { schedulerService.scheduleJob(JOB_ID, JobConfig.forJobRunnerKey(JOB_RUNNER_KEY) .withSchedule(Schedule.forCronExpression("0 19 * * * ?")) // collect stats daily at 00:19 .withRunMode(RunMode.RUN_ONCE_PER_CLUSTER)); } catch (SchedulerServiceException e) { log.warn("Failed to schedule daily alert analytics publishing job", e); } }
@Override public void start() throws Exception { SchedulerService scheduler = ComponentAccessor.getComponent(SchedulerService.class); scheduler.registerJobRunner(JOB_RUNNER_KEY, this); final JobConfig jobConfig = JobConfig.forJobRunnerKey(JOB_RUNNER_KEY) .withRunMode(RunMode.RUN_LOCALLY) .withSchedule(Schedule.forInterval(FIVE_MINUTES, null)); scheduler.scheduleJob(JOB_ID, jobConfig); }
@Override protected void startHeartbeat() throws SchedulerServiceException { super.startHeartbeat(); //Initially run explicitly to get the first run out immediately SharedHomeFileWriterJobRunner runner = new SharedHomeFileWriterJobRunner(); runner.writeFile(); schedulerService.registerJobRunner(SHARED_HOME_FILE_WRITER_JOB_RUNNER_KEY, runner); JobConfig jobConfig = JobConfig.forJobRunnerKey(SHARED_HOME_FILE_WRITER_JOB_RUNNER_KEY) .withRunMode(RunMode.RUN_LOCALLY) .withSchedule(Schedule.forInterval(TimeUnit.MINUTES.toMillis(1), null)); schedulerService.scheduleJob(JobId.of(SHARED_HOME_FILE_WRITER_JOB_RUNNER_KEY_NAME), jobConfig); }
@Override public void start() throws Exception { final SchedulerService scheduler = ComponentAccessor.getComponent(SchedulerService.class); scheduler.registerJobRunner(JOB_RUNNER_KEY, this); final JobConfig jobConfig = JobConfig.forJobRunnerKey(JOB_RUNNER_KEY) .withRunMode(RunMode.RUN_LOCALLY) .withSchedule(Schedule.forInterval(DAILY, null)); scheduler.scheduleJob(JOB_ID, jobConfig); } }
@Override public void onStart() { schedulerService = schedulerServiceProvider.getSchedulerService(); schedulerService.registerJobRunner(JOB_RUNNER_KEY, new LogScanReportRunner(this)); LogScanReportSettings settings = getReportSettings(); if (settings.isEnabled()) { scheduleLogScanJob(settings.getSchedule()); } }