Hi, If you have lots of different types of binary messages , check out
my litle library javastruct (http://code.google.com/p/javastruct/)
There are some examples and documents as well

http://code.google.com/p/javastruct/wiki/HowToUseJavaStruct
http://code.google.com/p/javastruct/wiki/example_photoshop_acb_file_reader_writer
and an incomplete example for mina
http://javastruct.googlecode.com/svn/trunk/javastruct/samples/mina/

if your protocol is not binary, you can ignore all this. I saved a lot
of time and code using this approach (we had more than 50 binary
little endian messages)

Mehmet

On Nov 9, 2007 10:22 AM, csantini <[EMAIL PROTECTED]> wrote:
>
> I have many Message classes that implements MessageDecoder and
> MessageEncoder, and they are all listed in a DemuxingProtocolCodecFactory.
> Now I need to be able to choose what decoder/encoder to use just depending
> on the second byte (opcode) I receive; I could implement a decodable() for
> each Message returning OK if the byte is right but it's slow with many
> Messages! I need to do something like this:
>
> switch(opCodeByte){
>   case 0x01: use HelloMessageDecoder
>   case 0x02: use DataMessageDecoder
>  ...
> }
>
> Maybe DemuxingIoHandler is the right way but there is no doc about, could
> you help me ?
> Thanks for your work and your beautiful framework!
>
> --
> View this message in context: 
> http://www.nabble.com/Many-message-decoder-encoder-tf4776815s16868.html#a13664414
> Sent from the Apache MINA Support Forum mailing list archive at Nabble.com.
>
>

Reply via email to