|
|
|
|
Re: Jobs API: Notify when Jobs finished [message #518148 is a reply to message #518147] |
Wed, 03 March 2010 09:22 |
Daniel Krügler Messages: 853 Registered: July 2009 |
Senior Member |
|
|
On 03.03.2010 10:18, Daniel Krügler wrote:
> On 03.03.2010 08:10, Matthias wrote:
>> that way i also get the status of a single job (within a job family).
>> but i want to be notified when all the jobs of a family are done.
>> I grouped the jobs with setProgressGroup() to an IProgressMonitor. I
>> didn't find out how to listen to its "done" event.
>> any ideas?
>
> You have to manage that on your own. The spec of belongsTo clearly
> documents the following:
>
> "[..] Job families are represented as objects that are not interpreted
> or specified in any way by the job manager. Thus, a job can choose to
> belong to any number of families. [..]"
>
> This makes it clear that the job manager cannot do that for you.
> It should be rather easy to implement that on you own: Create a Set
> that contains all of your started jobs that belong to the family
> you are interested in. Since you must already provide glue-code
> to properly implement belongsTo, this is already work that would
> belong to the responsibilities of the proper belongsTo implementation.
Should that be unclear: I mean here that there must exist your
own business logic that decides what belongsTo means. The same
business logic should probably administrate the Set of jobs,
I referred to in the text.
> Then register as filtered listener as described in my first reply.
> If the filter matches and belongsTo return true, ensure that
> you remove the corresponding entry from your set.
... in the done event, of-course.
Finally there will
> be some done event, where you have removed the last element from
> this Set and isEmpty returns true after the removal. This is the
> event you are interested in.
>
> HTH & Greetings from Bremen,
>
> Daniel Krügler
>
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02880 seconds