Using the eclipse jobs-API

Source: Internet
Author: User
ArticleDirectory
    • Putting it togehter
    • Scheduling rules
    • Using the example
    • Download
Tom Seidel @ 19:07

A common usecase is running long processes and waiting for their completion. therefore responsiveness is an important feature, that can be realized with the jobs-framework provided by eclipse. the user wants to continue working while a long running job is scheduled, not sitting in front of a frozen UI that is not responding until the job has finished.

Today I want to demonstrate some key features of the jobs API and encourage RCP developers to use the functionality to make a user friendly interaction and a clear management of your application-specific jobs. A good article for this topic you can find on the eclipse-website.

The eclipse jobs API can be divided into three parts:

Jobs
Jobs are created in the Plugins where the logic for processes are implemented. A job describes always a specific unit of work.

Job Manager
The job manager handles the queuing, starting and locking of jobs dependent from the properties of a job. when you schedule a job the job-manager will check the conditions like a scheduling-rule or a lock to avoid conflicts with other resources.

User Interface
The built-in user interface keeps the user on track and gives an overview of the scheduled jobs and their status.

Putting it togehter

No need for that. the frameworks takes the wiring of the tree components. if job # Schedule () is called the job is automatically queued into the job manager, the progressview will visualize the jobs that are queued.

Scheduling rules

With scheduling rules you can implement logic if a job can proceed or scheduled. Therefore you have to provide an implementation of ischedulingrule where the job-manager can determine if a job can be started.

Using the example

The example is a simple eclipse RCP that demonstrates some features of the job-API. it works not directly on a job object, but on a wrapper, that makes life more easier and can also be used as a third-party-plugin for job-handling within your RCP.
The following feature are covered:

    • Uijob/nonuijob
    • Dialog
    • Scheduling rules
    • Delay
    • Job returnvalues
    • Job-Images
Download

Download the jobs example as RCP (source encoded ded-10, 5 Mbyte)
Download the jobs example as plugin (source encoded ded-30 Kbyte)
CVS-checkout (more info)

Reprinted from:

Http://www.richclient2.de/2006_09_28/using-the-eclipse-jobs-api/#more-79

Reference: http://www.eclipse.org/articles/Article-Concurrency/jobs-api.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.