Jochanan wrote:I have overlooked, that the function is named differently.
What is the difference between addEventListener and addEventHandler and where we should use one or the other?
As i mentioned we've only documented the addEventHandler() method in our docs.
It's easier to use because you don't have to manually remove event handlers but it doesn't support multiple handlers, which is usually not a problem.
In your case you can use the addEventListener() method which is documented but can be used, if necessary. It's up to you... you might also not use it and simply dispatch your multiple events internally (via method calls). All this depends a lot on the specific requirements.
Only difference i have noticed so far is, that if we derivate from BaseServerEventHandler (which implements IServerEventHandler), than there are logging functions included.
Yes you're also missing those features. In alternative you can pass a reference of your Extension's logger to the listener.
Example:
Code: Select all
private EvtHandler evh1 = new EvtHandler(this.getLogger());
Then use the logger in your listener:
Hope it helps