2 Replies Latest reply on Jun 5, 2011 6:09 AM by timfox

    HornetQBuffer interface issue

    borges

      The interface org.hornetq.api.core.HornetQBuffer is meant to wrap Netty's ChannelBuffer. However, right at the top, we have a method with signature

       

      org.jboss.netty.buffer.ChannelBuffer channelBuffer();

       

      That doesn't look right to me. (Why go through the trouble of creating a wrapper if we are going to tie our interface to the wrapped object anyway) Is there any reason to have that there?

       

      Anyone opposes its removal?

       


        • 1. Re: HornetQBuffer interface issue
          clebert.suconic

          As far as I remember Tim didn't mean to have it in the first place while he was writing it, but he probably let it slip as we needed to finish the release... and other things.

           

          As we talked earlier on IRC:

           

          So, as long as this won't cause any performance issues and extra copies... lets remove it. you could create a JIRA and deal with this later. (Add a TODO on the code so we know about it when reading the code).

          • 2. Re: HornetQBuffer interface issue
            timfox

            IIRC this method is necessary since at some point we have to get a reference to the underlying Netty buffer before the buffer is sent to Netty. If you didn't have this you would have to do an ugly cast.