private void popPacket() { try { if (streamEnded) { // no more packets, we are over the last one already throw new IndexOutOfBoundsException(); } int sizeToAdd = currentPacket != null ? currentPacket.chunk.length : 1; currentPacket = largeMessageData.poll(readTimeout, TimeUnit.MILLISECONDS); if (currentPacket == null) { throw new IndexOutOfBoundsException(); } if (currentPacket.chunk == null) { // Empty packet as a signal to interruption currentPacket = null; streamEnded = true; throw new IndexOutOfBoundsException(); } consumerInternal.flowControl(currentPacket.getFlowControlSize(), !currentPacket.isContinues()); packetPosition += sizeToAdd; packetLastPosition = packetPosition + currentPacket.getChunk().length; } catch (IndexOutOfBoundsException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
/** * @param output * @param packet * @throws ActiveMQException */ private void sendPacketToOutput(final OutputStream output, final LargeData packet) throws ActiveMQException { try { output.write(packet.getChunk()); if (!packet.isContinues()) { streamEnded = true; output.close(); } } catch (IOException e) { throw ActiveMQClientMessageBundle.BUNDLE.errorWritingLargeMessage(e); } }
@Override public void setOutputStream(final OutputStream output) throws ActiveMQException { int totalFlowControl = 0; boolean continues = false; synchronized (this) { if (currentPacket != null) { sendPacketToOutput(output, currentPacket); currentPacket = null; } while (handledException == null) { LargeData packet = largeMessageData.poll(); if (packet == null) { break; } totalFlowControl += packet.getFlowControlSize(); continues = packet.isContinues(); sendPacketToOutput(output, packet); } checkException(); outStream = output; } if (totalFlowControl > 0) { consumerInternal.flowControl(totalFlowControl, !continues); } }
private void popPacket() { try { if (streamEnded) { // no more packets, we are over the last one already throw new IndexOutOfBoundsException(); } int sizeToAdd = currentPacket != null ? currentPacket.chunk.length : 1; currentPacket = largeMessageData.poll(readTimeout, TimeUnit.MILLISECONDS); if (currentPacket == null) { throw new IndexOutOfBoundsException(); } if (currentPacket.chunk == null) { // Empty packet as a signal to interruption currentPacket = null; streamEnded = true; throw new IndexOutOfBoundsException(); } consumerInternal.flowControl(currentPacket.getFlowControlSize(), !currentPacket.isContinues()); packetPosition += sizeToAdd; packetLastPosition = packetPosition + currentPacket.getChunk().length; } catch (IndexOutOfBoundsException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
@Override public void setOutputStream(final OutputStream output) throws ActiveMQException { int totalFlowControl = 0; boolean continues = false; synchronized (this) { if (currentPacket != null) { sendPacketToOutput(output, currentPacket); currentPacket = null; } while (handledException == null) { LargeData packet = largeMessageData.poll(); if (packet == null) { break; } totalFlowControl += packet.getFlowControlSize(); continues = packet.isContinues(); sendPacketToOutput(output, packet); } checkException(); outStream = output; } if (totalFlowControl > 0) { consumerInternal.flowControl(totalFlowControl, !continues); } }
private void popPacket() { try { if (streamEnded) { // no more packets, we are over the last one already throw new IndexOutOfBoundsException(); } int sizeToAdd = currentPacket != null ? currentPacket.chunk.length : 1; currentPacket = largeMessageData.poll(readTimeout, TimeUnit.MILLISECONDS); if (currentPacket == null) { throw new IndexOutOfBoundsException(); } if (currentPacket.chunk == null) { // Empty packet as a signal to interruption currentPacket = null; streamEnded = true; throw new IndexOutOfBoundsException(); } consumerInternal.flowControl(currentPacket.getFlowControlSize(), !currentPacket.isContinues()); packetPosition += sizeToAdd; packetLastPosition = packetPosition + currentPacket.getChunk().length; } catch (IndexOutOfBoundsException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
@Override public void setOutputStream(final OutputStream output) throws ActiveMQException { int totalFlowControl = 0; boolean continues = false; synchronized (this) { if (currentPacket != null) { sendPacketToOutput(output, currentPacket); currentPacket = null; } while (handledException == null) { LargeData packet = largeMessageData.poll(); if (packet == null) { break; } totalFlowControl += packet.getFlowControlSize(); continues = packet.isContinues(); sendPacketToOutput(output, packet); } checkException(); outStream = output; } if (totalFlowControl > 0) { consumerInternal.flowControl(totalFlowControl, !continues); } }
private void popPacket() { try { if (streamEnded) { // no more packets, we are over the last one already throw new IndexOutOfBoundsException(); } int sizeToAdd = currentPacket != null ? currentPacket.chunk.length : 1; currentPacket = largeMessageData.poll(readTimeout, TimeUnit.MILLISECONDS); if (currentPacket == null) { throw new IndexOutOfBoundsException(); } if (currentPacket.chunk == null) { // Empty packet as a signal to interruption currentPacket = null; streamEnded = true; throw new IndexOutOfBoundsException(); } consumerInternal.flowControl(currentPacket.getFlowControlSize(), !currentPacket.isContinues()); packetPosition += sizeToAdd; packetLastPosition = packetPosition + currentPacket.getChunk().length; } catch (IndexOutOfBoundsException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
@Override public void setOutputStream(final OutputStream output) throws ActiveMQException { int totalFlowControl = 0; boolean continues = false; synchronized (this) { if (currentPacket != null) { sendPacketToOutput(output, currentPacket); currentPacket = null; } while (handledException == null) { LargeData packet = largeMessageData.poll(); if (packet == null) { break; } totalFlowControl += packet.getFlowControlSize(); continues = packet.isContinues(); sendPacketToOutput(output, packet); } checkException(); outStream = output; } if (totalFlowControl > 0) { consumerInternal.flowControl(totalFlowControl, !continues); } }
@Override public void setOutputStream(final OutputStream output) throws ActiveMQException { int totalFlowControl = 0; boolean continues = false; synchronized (this) { if (currentPacket != null) { sendPacketToOutput(output, currentPacket); currentPacket = null; } while (handledException == null) { LargeData packet = largeMessageData.poll(); if (packet == null) { break; } totalFlowControl += packet.getFlowControlSize(); continues = packet.isContinues(); sendPacketToOutput(output, packet); } checkException(); outStream = output; } if (totalFlowControl > 0) { consumerInternal.flowControl(totalFlowControl, !continues); } }
private void popPacket() { try { if (streamEnded) { // no more packets, we are over the last one already throw new IndexOutOfBoundsException(); } int sizeToAdd = currentPacket != null ? currentPacket.chunk.length : 1; currentPacket = largeMessageData.poll(readTimeout, TimeUnit.MILLISECONDS); if (currentPacket == null) { throw new IndexOutOfBoundsException(); } if (currentPacket.chunk == null) { // Empty packet as a signal to interruption currentPacket = null; streamEnded = true; throw new IndexOutOfBoundsException(); } consumerInternal.flowControl(currentPacket.getFlowControlSize(), !currentPacket.isContinues()); packetPosition += sizeToAdd; packetLastPosition = packetPosition + currentPacket.getChunk().length; } catch (IndexOutOfBoundsException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
private void popPacket() { try { if (streamEnded) { // no more packets, we are over the last one already throw new IndexOutOfBoundsException(); } int sizeToAdd = currentPacket != null ? currentPacket.chunk.length : 1; currentPacket = largeMessageData.poll(readTimeout, TimeUnit.MILLISECONDS); if (currentPacket == null) { throw new IndexOutOfBoundsException(); } if (currentPacket.chunk == null) { // Empty packet as a signal to interruption currentPacket = null; streamEnded = true; throw new IndexOutOfBoundsException(); } consumerInternal.flowControl(currentPacket.getFlowControlSize(), !currentPacket.isContinues()); packetPosition += sizeToAdd; packetLastPosition = packetPosition + currentPacket.getChunk().length; } catch (IndexOutOfBoundsException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
@Override public void setOutputStream(final OutputStream output) throws ActiveMQException { int totalFlowControl = 0; boolean continues = false; synchronized (this) { if (currentPacket != null) { sendPacketToOutput(output, currentPacket); currentPacket = null; } while (handledException == null) { LargeData packet = largeMessageData.poll(); if (packet == null) { break; } totalFlowControl += packet.getFlowControlSize(); continues = packet.isContinues(); sendPacketToOutput(output, packet); } checkException(); outStream = output; } if (totalFlowControl > 0) { consumerInternal.flowControl(totalFlowControl, !continues); } }
private void popPacket() { try { if (streamEnded) { // no more packets, we are over the last one already throw new IndexOutOfBoundsException(); } int sizeToAdd = currentPacket != null ? currentPacket.chunk.length : 1; currentPacket = largeMessageData.poll(readTimeout, TimeUnit.MILLISECONDS); if (currentPacket == null) { throw new IndexOutOfBoundsException(); } if (currentPacket.chunk == null) { // Empty packet as a signal to interruption currentPacket = null; streamEnded = true; throw new IndexOutOfBoundsException(); } consumerInternal.flowControl(currentPacket.getFlowControlSize(), !currentPacket.isContinues()); packetPosition += sizeToAdd; packetLastPosition = packetPosition + currentPacket.getChunk().length; } catch (IndexOutOfBoundsException e) { throw e; } catch (Exception e) { throw new RuntimeException(e); } }
/** * @param output * @param packet * @throws ActiveMQException */ private void sendPacketToOutput(final OutputStream output, final LargeData packet) throws ActiveMQException { try { output.write(packet.getChunk()); if (!packet.isContinues()) { streamEnded = true; output.close(); } } catch (IOException e) { throw ActiveMQClientMessageBundle.BUNDLE.errorWritingLargeMessage(e); } }
/** * @param output * @param packet * @throws ActiveMQException */ private void sendPacketToOutput(final OutputStream output, final LargeData packet) throws ActiveMQException { try { output.write(packet.getChunk()); if (!packet.isContinues()) { streamEnded = true; output.close(); } } catch (IOException e) { throw ActiveMQClientMessageBundle.BUNDLE.errorWritingLargeMessage(e); } }
/** * @param output * @param packet * @throws ActiveMQException */ private void sendPacketToOutput(final OutputStream output, final LargeData packet) throws ActiveMQException { try { output.write(packet.getChunk()); if (!packet.isContinues()) { streamEnded = true; output.close(); } } catch (IOException e) { throw ActiveMQClientMessageBundle.BUNDLE.errorWritingLargeMessage(e); } }
/** * @param output * @param packet * @throws ActiveMQException */ private void sendPacketToOutput(final OutputStream output, final LargeData packet) throws ActiveMQException { try { output.write(packet.getChunk()); if (!packet.isContinues()) { streamEnded = true; output.close(); } } catch (IOException e) { throw ActiveMQClientMessageBundle.BUNDLE.errorWritingLargeMessage(e); } }
/** * @param output * @param packet * @throws ActiveMQException */ private void sendPacketToOutput(final OutputStream output, final LargeData packet) throws ActiveMQException { try { output.write(packet.getChunk()); if (!packet.isContinues()) { streamEnded = true; output.close(); } } catch (IOException e) { throw ActiveMQClientMessageBundle.BUNDLE.errorWritingLargeMessage(e); } }
/** * @param output * @param packet * @throws ActiveMQException */ private void sendPacketToOutput(final OutputStream output, final LargeData packet) throws ActiveMQException { try { output.write(packet.getChunk()); if (!packet.isContinues()) { streamEnded = true; output.close(); } } catch (IOException e) { throw ActiveMQClientMessageBundle.BUNDLE.errorWritingLargeMessage(e); } }