Package org.apache.qpid.proton.engine

Examples of org.apache.qpid.proton.engine.Receiver


   }

   @Override
   public void onMessage(Delivery delivery) throws HornetQAMQPException
   {
      Receiver receiver = null;
      try
      {
         receiver = ((Receiver) delivery.getLink());

         if (!delivery.isReadable())
View Full Code Here


        private final byte[] recvBuffer = new byte[1024 * 8];

        @Override
        public void onDelivery(Delivery delivery) throws Exception {
            Receiver receiver = ((Receiver) delivery.getLink());
            if (!delivery.isReadable()) {
                LOG.debug("Delivery was not readable!");
                return;
            }

            if (current == null) {
                current = new ByteArrayOutputStream();
            }

            int count;
            while ((count = receiver.recv(recvBuffer, 0, recvBuffer.length)) > 0) {
                current.write(recvBuffer, 0, count);
            }

            // Expecting more deliveries..
            if (count == 0) {
                return;
            }

            receiver.advance();
            Buffer buffer = current.toBuffer();
            current = null;
            onMessage(receiver, delivery, buffer);
        }
View Full Code Here

        private final byte[] recvBuffer = new byte[1024 * 8];

        @Override
        public void onDelivery(Delivery delivery) throws Exception {
            Receiver receiver = ((Receiver) delivery.getLink());
            if (!delivery.isReadable()) {
                LOG.debug("Delivery was not readable!");
                return;
            }

            if (current == null) {
                current = new ByteArrayOutputStream();
            }

            int count;
            while ((count = receiver.recv(recvBuffer, 0, recvBuffer.length)) > 0) {
                current.write(recvBuffer, 0, count);
            }

            // Expecting more deliveries..
            if (count == 0) {
                return;
            }

            receiver.advance();
            Buffer buffer = current.toBuffer();
            current = null;
            onMessage(receiver, delivery, buffer);
        }
View Full Code Here

TOP

Related Classes of org.apache.qpid.proton.engine.Receiver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.