Menu

#9 More changes needed for custom DataEventListener

open
nobody
None
5
2009-06-01
2009-06-01
Craig M
No

This feature request is related to my previous request with ID 1815809, I should have been more detailed before.

As stated in the previous request, my need is to handle additional event types in the DataEventListener's run method. The reason for having a protected startDataEventListener method is so that I could start my own version of the DataEventListener. At the moment I have to run what is virtually a copy/paste of the normal DataEventListener with a few lines added. I also have to break encapsulation in a couple of places because the DataEventListener uses some private methods that I need. The additional changes that would be needed are:

1) Make DataEventListener protected
2) The last 'else' block in DataEventListener.run() logs a warning if it doesn't recognize the event type. Please move this warning to a protected method with a signature that is something like 'handleUnknownEventType(String eventType, Event event, Listener listener)'. The default implementation of this method can still log the warning, but this will allow subclasses to easily add support for additional event types.
3) Make doControl(Event) protected. I have custom Subscriber and Subscription implementations (thanks for the configurable factory methods) that require some additional fields. By being able to intercept events in doControl I could inspect and modify the event before calling super.doControl(event)

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.