public interface IJobFunction
Job
, suitable
for use in lambda expressions.Job.create(String, IJobFunction)
Modifier and Type | Method and Description |
---|---|
IStatus |
run(IProgressMonitor monitor)
Executes this job.
|
IStatus run(IProgressMonitor monitor)
The provided monitor can be used to report progress and respond to
cancellation. If the progress monitor has been canceled, the job should
finish its execution at the earliest convenience and return a result
status of severity IStatus.CANCEL
. The singleton cancel status
Status.CANCEL_STATUS
can be used for this purpose. The monitor is
only valid for the duration of the invocation of this method.
This method must not be called directly by clients. Clients should call
schedule
, which will in turn cause this method to be called.
Jobs can optionally finish their execution asynchronously (in another
thread) by returning a result status of Job.ASYNC_FINISH
. Jobs
that finish asynchronously must specify the execution thread by
calling Job.setThread(Thread)
, and must indicate when they are
finished by calling the method Job.done(IStatus)
.
monitor
- the monitor to be used for reporting progress and responding
to cancellation. The monitor is never null
. It is the
caller's responsibility to call
IProgressMonitor.done()
after this method returns or
throws an exception.null
.Job.ASYNC_FINISH
,
Job.done(IStatus)
Copyright (c) 2000, 2016 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.