> From: Paolo Perrucci [mailto:[EMAIL PROTECTED] > > I understand that encoding/decoding can be optional but I think that in > some cases they can help to simplify the code. > For example, in the last days I developed a tcp server (using > ProtocolHandler) that read ReadMessage objects and write WriteMessage > objects. > Hence I wrote a TcpProtocolEncoder that trasform WriteMessage to > ByteBuffer and a TcpProtocolDecoder that trasform ByteBuffer to > ReadMessage. > Now I would like to add the vm pipe transport type support to the same > server but because I can't use encoding/decoding, MINA call > ProtocolHandler.messageReceived() with a message of type WriteMessage. > So when receiving messages from a vm pipe client the messageReceived() > should first trasform the WriteMessage in a ReadMessage. > Hence the messageReceived() code depends on the session trasport type. > > My question is: is there a design flaw in my project or I missed > something in the use of vm pipe trasport type? >
I do not know about design flaws. :-) But remember that you need to bind your server to the VM_PIPE, separately The protocol handler that you use for that binding may be the right place to perform your bean2bean conversion (if you want to reuse the other code). Remember, VM_PIPE do not use buffers or char arrays, hence encoders/decoders make no sense. You do not have the right objects. Jose
