Community
Participate
Working Groups
...so one can listen to submits without creation/initiating them.
Sounds like a good idea. I would suggest doing the same for ITaskDataManagerListener. This would probably need to happen through an extension point to ensure that clients are notified regardless of bundle activation.
Exactly what I was looking for. The interface at least for submits could look similar to the IJobChangeListener interface, meaning hooks like aboutToSubmit(), submitted(). I think no veto support is required.
Created attachment 210414 [details] patch Steffen, what do you think of this? I considered reusing SubmitTaskJob instead of defining a new interface but the problem is that it if threw an exception it would break all submits.
Created attachment 210415 [details] mylyn/context/zip
That's a good start. SubmitJobListener is indeed a poor name, it should have been called SubmitJobParticipant. How about we create a TaskJobListener class? Here a few suggestions: * To make the listener interface extensible in the future I would prefer an abstract class and event class (like SubmitJobEvent) that encapsulates the event parameters so we can add additional properties as needed, e.g. the job result. * The extension handler should use ExtensionPointReader and create extensions as lazy as possible. * We should consider adding a connectorKind field to the extension point to support listening for specific connectors only. This would require an enhancement to ExtensionPointReader to support filtering of extensions. Can you push a code review for the next iteration?
Sure. I like those suggestions, but I'm unsure how it could be made more lazy, other than only loading listeners for a specific connector when that connector does a submit, which may or may not be more efficient.
(In reply to comment #6) > Sure. I like those suggestions, but I'm unsure how it could be made more lazy, > other than only loading listeners for a specific connector when that connector > does a submit, which may or may not be more efficient. I guess I was thinking that the extension point should be parsed when the event is fired but that wouldn't make much of a difference. It doesn't seem quite right though to store a static reference to listeners in SubmitTaskJob. That should be handled in TaskJobFactory and injected through the constructor.
I've created the following review: I26f2ccd9: NEW - bug 333930: [api] provide ability to get notified of changes to task data and submits https://bugs.eclipse.org/bugs/show_bug.cgi?id=333930 http://review.mylyn.org/#change,254
Created attachment 210480 [details] changes to ExtensionPointReader changes to ExtensionPointReader to support filtering elements by attribute value
Thanks Sam. Can you open a new bug for the ExtensionPointReader enhancement? I would also like to consider adding support for a priority attribute. Can you move the review to the master branch? It looks like it's currently building against the e_3_7_m_3_6_x branch: http://review.mylyn.org/#change,254
New review: http://review.mylyn.org/#change,262 (the original had no change id).
As discussed on bug 370772, we should also include the old task in the event.
Sam, could you please also consider a hook before the task is actually submitted - something like "aboutToSubmit()" as mentioned in comment:2? I think that kind of pre-submit hook is required at least in some cases we have.
(In reply to comment #13) > Sam, could you please also consider a hook before the task is actually submitted > - something like "aboutToSubmit()" as mentioned in comment:2? I think that kind > of pre-submit hook is required at least in some cases we have. That makes sense to me and should be trivial to add.
I have updated the review.
Thanks! That looks good. Please add a few lines of documentation to TaskJobListener and attach a patch. I'll then go ahead and merge the contribution.
Created attachment 211018 [details] patch Note that I changed the id of the extension point to match the schema file name
Thanks! I have committed the patch. I'll push it as soon as git access is restored.
To use the new API register an extension for the org.eclipse.mylyn.tasks.core.taskJobListener extension point that extends TaskJobListener. The listener instance is notified before task submissions takes place and after it has completed.