You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Frédéric Brégier <fr...@free.fr> on 2007/12/10 08:02:26 UTC

Re: messageSent on DemuxingIoHandler

Hi Trustin,
I am still not sure on the answear. For the moment,
I do like both methods are called when message is
send (both from the specific MessageHandler and from
DemuxingIoHandler).

Frederic
----- Original Message ----- 

Hi Trustin,

Well, I am sometime (always ?) quite long in my email
and obviously not necesseraly more clear than others.. ;-)

The problem I found (is this a problem, I don't know) is :
1) In the past, only DemuxingIoHandler has messageSent() function
    to overload but not mandatory (you can if you want not define
    anything). In my code, I had some codes to do some stuff
    after the message is really sent.
2) Now, in trunk, MessageHandler has a mandatory messageSent()
    function.
    As when you use DemuxingIoHandler, you should use also object
    that extends MessageHandler, I feel like a bit loose.
    
Contrary to what I wrote before, I would not suggest to remove
the messageSent() from DemuxingIoHandler since a message can be
sent, even if no MessageHandler is registered for it.
I try in my code, and I saw "DemuxingIoHandler.messageSent()" called
for such message not registered.

Now the question :
If one messageHandler is registered and such a message is sent, which function will be called ?
DemuxingIoHandler.messageSent() on all messages ? or only on not registered messages ?
MessageHandler.messageSent() on all messages that are registered ? 
Or only one (for registered message) ?
As I need to do some stuff after message is sent, I don't know if I need to
writye the same code (or so) in each messageSent() of MessageHandler.

I hope I am more clear, this time.

And for JMX, I was starting to think about it since I feel like I really should improve
this part in my app. So thank you for this ! I start probably this week some benchmark
(I hope almost all my port to "new" trunk is done). After that, I could spend some useful
time on JMX approach...

Frederic
----- Original Message ----- 
From: "Trustin Lee" 

On Nov 22, 2007 5:40 PM,  fred.bregier wrote:
> I suppose the one from MessageHandler is the one that would be executed, right ?
>
> Since we must defined messageSent function in MessageHandler
> (mandatory), second it is not mandatory to get it in DemuxingIoHandler,
> third as you said only one will be called (the one from
> MessageHandler ?), I would say that probably this function in
> DemuxingIoHandler is no more necessary and probably confusing with the
> one from MessageHandler.
> Except if one can use DemuxingIoHandler with something totally different
> from MessageHandler (?), I would suggest to remove this function (or mark
> it as deprecated and pointing to the one in MessageHandler). WDYT ?

I didn't get the question actually.  Could explain again?

Thanks in advance,
Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6