Hi folks,

I'm reviewing MINA 1.1.0-SNAPSHOT.  While fixing some compiler
warning, I found that o.a.mina.handler.demux.MessageHandler can use
Java 5 Generics because the implementor will expect that a certain
type of message will be received to the implementation.  So I added a
type parameter to the MessageHandler and modified the public method
declaration of the DemuxingIoHandler as the following:

----------------
   public <E> MessageHandler<? super E> addMessageHandler( Class<E>
type, MessageHandler<? super E> handler )

   public <E> MessageHandler<? super E> removeMessageHandler( Class<E> type )

   public <E> MessageHandler<? super E> getMessageHandler( Class<E> type )
----------------

and, here's the modified MessageHandler:

----------------
public interface MessageHandler<E>
{
   ......
   void messageReceived( IoSession session, E message ) throws Exception;
}
----------------

What do you think?  Would this change be useful, or should I revert back?

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

Reply via email to