Eclipse Platform
Release 3.0

org.eclipse.core.runtime.jobs
Interface IJobChangeListener

All Known Implementing Classes:
JobChangeAdapter

public interface IJobChangeListener

Callback interface for clients interested in being notified when jobs change state.

A single job listener instance can be added either to the job manager, for notification of all scheduled jobs, or to any set of individual jobs. A single listener instance should not be added to both the job manager, and to individual jobs (such a listener may receive duplicate notifications).

Clients should not rely on the result of the Job#getState() method on jobs for which notification is occurring. Listeners are notified of all job state changes, but whether the state change occurs before, during, or after listeners are notified is unspecified.

Clients may implement this interface.

Since:
3.0
See Also:
JobChangeAdapter, IJobManager.addJobChangeListener(IJobChangeListener), IJobManager.removeJobChangeListener(IJobChangeListener), Job.addJobChangeListener(IJobChangeListener), Job.getState(), Job.removeJobChangeListener(IJobChangeListener)

Method Summary
 void aboutToRun(IJobChangeEvent event)
          Notification that a job is about to be run.
 void awake(IJobChangeEvent event)
          Notification that a job was previously sleeping and has now been rescheduled to run.
 void done(IJobChangeEvent event)
          Notification that a job has completed execution, either due to cancelation, successful completion, or failure.
 void running(IJobChangeEvent event)
          Notification that a job has started running.
 void scheduled(IJobChangeEvent event)
          Notification that a job is being added to the queue of scheduled jobs.
 void sleeping(IJobChangeEvent event)
          Notification that a job was waiting to run and has now been put in the sleeping state.
 

Method Detail

aboutToRun

public void aboutToRun(IJobChangeEvent event)
Notification that a job is about to be run. Listeners are allowed to sleep, cancel, or change the priority of the job before it is started (and as a result may prevent the run from actually occurring).

Parameters:
event - the event details

awake

public void awake(IJobChangeEvent event)
Notification that a job was previously sleeping and has now been rescheduled to run.

Parameters:
event - the event details

done

public void done(IJobChangeEvent event)
Notification that a job has completed execution, either due to cancelation, successful completion, or failure. The event status object indicates how the job finished, and the reason for failure, if applicable.

Parameters:
event - the event details

running

public void running(IJobChangeEvent event)
Notification that a job has started running.

Parameters:
event - the event details

scheduled

public void scheduled(IJobChangeEvent event)
Notification that a job is being added to the queue of scheduled jobs. The event details includes the scheduling delay before the job should start running.

Parameters:
event - the event details, including the job instance and the scheduling delay

sleeping

public void sleeping(IJobChangeEvent event)
Notification that a job was waiting to run and has now been put in the sleeping state.

Parameters:
event - the event details

Eclipse Platform
Release 3.0

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.