Hi Trustin, >I've made more change to MessageHandler and DemuxingIoHandler to fix >the API design issue you raised. Please take a look at the following >change log. The code will explain everything: > > http://svn.apache.org/viewvc?view=rev&revision=603158
I understand again more clearly after your words what I should do. I suppose I was confusing with the "standard way" of IoHandler. I didn't make the necessary change in my code as I should do. So I will make the change ASAP, taking the last revision of trunk to test it. I quickly read your change, and I feel like it could do the trick. I will come back to you with my final impression. >You could simply register MessageHandler.NOOP to that type of message, >no? If you want to ignore all messageSent events, then you can even >do the following: > > handler.addSentMessageHandler(MessageHandler.NOOP); > >Especially with the change I've just made, I think all the concerns >you raised have been resolved. Please let me know if there's any case >that I missed out. Let me come back after I made the change. > > If I am correct, in my case, it is therefore necessary to keep both ways > > as possible in MINA. > > Except perhaps I break the logic of Min by doing this ? > >The possibility of overriding >DemuxingIoHandler.messageReceived/messageSent/exceptionCaught/findReceivedMessageHandler/findSentMessageHandler/findExceptionHandler >means that anyone who extends DemuxingIoHandler can break the existing >logic of DemuxingIoHandler. We could make all these methods final and >provide a kind of hook methods whose access modifier is 'protected'. >Assuming my recent change has resolved all the issues you raised, we >could do that. WDYT? Yes, I think if one should not overriding such methods, you probably have to make them final, espcially considering it is quite different than standard way (standard IoHandler, where you have to override them in the IoHandler) and so should be point both in documentation API and with the "final" word. >> Should I register those written only MessageHandler even if I never received >> one of them ? >> Perhaps it is related more to your question on splitting MessageHandler ? >> I don't like to make the API growing more and more, but you probably know >> better >> than me what it is better ot not in this case. > >Yes, you have to register MessageHandler.NOOP at least to avoid an >exception. I think it's mandatory to prevent any mistake that a user >might forget to register a required handler. OK, I will make the change and come back to you. I suppose it should not take too long... (I hope) Thank you again for your help ! Frederic
