Bug 341670 - [services] Automatically call DsfSession.addServiceEventListener()
Summary: [services] Automatically call DsfSession.addServiceEventListener()
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf (show other bugs)
Version: 7.0   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-01 16:12 EDT by Marc Khouzam CLA
Modified: 2020-09-04 15:17 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.