com.atlassian.scheduler
Interface JobRunner


@PublicSpi
public interface JobRunner

Invoked by the SchedulerService when it is time for a scheduled job to run.

Application code should register the JobRunner on startup, and need do nothing on shutdown.

Plugins should register the JobRunner implementation at startup/plugin enabled, and unregister the JobRunner when the plugin is disabled.


Method Summary
 JobRunnerResponse runJob(JobRunnerRequest request)
          Called by the SchedulerService when it is time for a job to run.
 

Method Detail

runJob

@Nullable
JobRunnerResponse runJob(JobRunnerRequest request)
Called by the SchedulerService when it is time for a job to run. The job is expected to perform its own error handling by catching exceptions as appropriate and reporting an informative message using JobRunnerResponse.failed(String).

Parameters:
request - the information about the request that was supplied by the scheduler service
Returns:
a JobRunnerResponse providing additional detail about the result of running the job. The response is permitted to be null, which is treated as identical to JobRunnerResponse.success().


Copyright © 2014 Atlassian. All Rights Reserved.