Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 341670

Summary: [services] Automatically call DsfSession.addServiceEventListener()
Product: [Tools] CDT Reporter: Marc Khouzam <marc.khouzam>
Component: cdt-debug-dsfAssignee: Project Inbox <cdt-debug-dsf-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: enhancement    
Priority: P3 CC: cdtdoug, fchouinard
Version: 7.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Marc Khouzam CLA 2011-04-01 16:12:38 EDT
I keep making the mistake of forgetting to call DsfSession.addServiceEventListener() when adding a @DsfServiceEventHandler to a class for the first time.

I always found this DSF requirement annoying.

After talking with Francois who also uses the @ServiceEventHandler pattern in the tracing framework (TMF), he suggested to automatically call DsfSession.addServiceEventListener() in AbstractDsfService.register() if any @DsfServiceEventHandler is present.  And similarly to call removeServiceEventListener() from unregister().

This would allow extenders of DSF to simply use @DsfServiceEventHandler without needed to remember to add the class as an eventListener.

We didn't look at the details of it, or done any prototype, but it seemed like a good idea.

I believe we could do this without any API changes or breaking existing behavior, so we could even do it for Indigo, although not necessary.
Comment 1 Pawel Piech CLA 2011-04-01 16:46:48 EDT
+1 Makes sense to me.