Community
Participate
Working Groups
The new jobs API allows to define and schedule jobs. The open source ClearCase plugin uses these jobs to fetch data for a resource in the background. It is possible that as many jobs as project resources are scheduled (I saw a lot more than 100 jobs). A scheduling rule ensures that only one update/refresh operation is ongoing (because of JNI and other limits). Even if the custom jobs provide a correct hashCode and equals implementation duplicate jobs (for the same resource) might be added because there is no API to check if a specific job is already schedulded. It would be nice if it is possible to define a job queue where all these jobs are attached to and only the job queue shows up in the progress view. This queue could also provide priority processing. It sleeps if no jobs are queued and it wakes up if the a job is queued. I think of a simple subclass of Job that implements this queue behavior. It allows to queue other jobs with a priority and it checks for duplicates.
I considered this very early on during the jobs API development, and in fact, many jobs currently do something just like this. It doesn't add a huge value to put it in the API though... apart from a free priority queue implementation, you can just create a job to do this yourself. With the PriorityQueue that is added in JDK 1.5, you can write this with only a couple of lines of code.