On Dec 17, 2007 5:20 PM, Steve Johns <[EMAIL PROTECTED]> wrote: <snip/>
> > > Can you give more hints about what the CACHE is? > > > > In you encoder, you could maintain a Map whose key is some message key > > and whose value is encoded ByteBuffer (or byte[]). It could probably > > be a LRUMap implementation that is provided by 3rd party collections > > API such as Apache Commons Collections. You could query the map if > > there's already an encoded form of the message, and reuse the encoded > > data if there's one in your encoder implementation. > > Thanks. Trustin. I totally understood. However, where I do the message - > > byte[] part? Is that supposed to be in the Encoder? But what suggested > seems doing the encoding message -> byte[] part in IoHandlerAdapter or > Busniess logic. Yes, you are supposed to do that in the ProtocolEncoder. It doesn't mean that you can't do that in the IoHandlerAdaptor or business logic, but it's not recommended in most cases. That's why I suggested you to use cache in the encoder. HTH, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP Key ID: 0x0255ECA6
