zoukankan      html  css  js  c++  java
  • Using the Eclipse JobsAPI(转载)

    Tom Seidel @ 19:07

    jobs_title.pngA 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

    jobs_rcp.png

    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 included - 10,5 Mbyte)
    Download the Jobs Example as Plugin (Source included - 30 kbyte)
    cvs_persp.gif CVS-Checkout (more info)

    转载自:

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

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

  • 相关阅读:
    uva 10099(最大生成树+搜索)
    Codeforces Round #218 (Div. 2) 解题报告
    CodeChef December Challenge 2013 解题报告
    Codeforces Round #217 (Div. 2) 解题报告
    uva 1423 (拓扑排序)
    UESTC 1307 windy数(数位DP)
    Codeforces Round #216 (Div. 2) 解题报告
    Codeforces Round #215 (Div. 2) 解题报告
    uva 10047(BFS)
    uva 10369(最小生成树)
  • 原文地址:https://www.cnblogs.com/wuhenke/p/2384417.html
Copyright © 2011-2022 走看看