You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Trustin Lee <tr...@gmail.com> on 2005/09/21 18:44:57 UTC

[mina] Do we need ProtocolViolationException.getBuffer()?

Hi,

There is a method 'getBuffer()' in ProtocolViolationException which returns
the read buffer caused the exception. Users can inspect the buffer to find
out what problem was. ProtocolViolationException.getMessage() appends the
hexadecimal dump to the original message provided by user and returns the
appended message.

The problem here is that we don't know when to release the buffer. We can
simply release the buffer just after exceptionCaught() event handler is
invoked for ProtocolViolationException. Or we can remove getBuffer() method
if is doesn't have any useful reason to survive.

What do you think? Do you see any good reason to retain getBuffer() method?

Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/

Re: [mina] Do we need ProtocolViolationException.getBuffer()?

Posted by Jean-François Daune <da...@daune-consult.com>.
Trustin Lee wrote:

> Hi,
>
> There is a method 'getBuffer()' in ProtocolViolationException which 
> returns the read buffer caused the exception.  Users can inspect the 
> buffer to find out what problem was.  
> ProtocolViolationException.getMessage () appends the hexadecimal dump 
> to the original message provided by user and returns the appended message.
>
> The problem here is that we don't know when to release the buffer.  We 
> can simply release the buffer just after exceptionCaught() event 
> handler is invoked for ProtocolViolationException.  Or we can remove 
> getBuffer() method if is doesn't have any useful reason to survive.
>
> What do you think?  Do you see any good reason to retain getBuffer() 
> method?
>
> Trustin
> -- 
> what we call human nature is actually human habit
> --
> http://gleamynode.net/ <http://gleamynode.net/>

I think it is useful to have a dump of message causing exceptions. But 
the buffer itself, I don't know.

Maybe just storing a dump in the ProtocolViolationException is enough.

J-F