/** * Add a buff to the List, or save it to the OutputStream if set */ @Override public void addPacket(byte[] chunk, int flowControlSize, boolean isContinues) { bufferDelegate.addPacket(chunk, flowControlSize, isContinues); }
private void resetLargeMessageController() { LargeMessageController controller = currentLargeMessageController; if (controller != null) { controller.cancel(); currentLargeMessageController = null; } }
/** * */ @Override public void discardUnusedPackets() { bufferDelegate.discardUnusedPackets(); }
@Override public void saveToOutputStream(final OutputStream out) throws ActiveMQException { if (writableBuffer != null) { // The body was rebuilt on the client, so we need to behave as a regular message on this case super.saveToOutputStream(out); } else { largeMessageController.saveBuffer(out); } }
@Override public ClientLargeMessageImpl setOutputStream(final OutputStream out) throws ActiveMQException { if (writableBuffer != null) { super.setOutputStream(out); } else { largeMessageController.setOutputStream(out); } return this; }
/** * @param timeWait Milliseconds to Wait. 0 means forever */ @Override public synchronized boolean waitCompletion(final long timeWait) throws ActiveMQException { return bufferDelegate.waitCompletion(timeWait); }
@Override public long getSize() { return this.bufferDelegate.getSize(); }
private void checkBuffer() throws ActiveMQException { if (writableBuffer == null) { long bodySize = this.largeMessageSize + BODY_OFFSET; if (bodySize > Integer.MAX_VALUE) { bodySize = Integer.MAX_VALUE; } initBuffer((int) bodySize); writableBuffer = new ResetLimitWrappedActiveMQBuffer(BODY_OFFSET, buffer.duplicate(), this); largeMessageController.saveBuffer(new ActiveMQOutputStream(writableBuffer)); } }
@Override public void setOutputStream(final OutputStream output) throws ActiveMQException { bufferDelegate.setOutputStream(new InflaterWriter(output)); }
@Override public boolean waitOutputStreamCompletion(final long timeMilliseconds) throws ActiveMQException { if (writableBuffer != null) { return super.waitOutputStreamCompletion(timeMilliseconds); } else { return largeMessageController.waitCompletion(timeMilliseconds); } }
@Override public long getSize() { return this.bufferDelegate.getSize(); }
@Override public synchronized void close() { bufferDelegate.cancel(); }
@Override public void saveToOutputStream(final OutputStream out) throws ActiveMQException { if (writableBuffer != null) { // The body was rebuilt on the client, so we need to behave as a regular message on this case super.saveToOutputStream(out); } else { largeMessageController.saveBuffer(out); } }
@Override public ClientLargeMessageImpl setOutputStream(final OutputStream out) throws ActiveMQException { if (writableBuffer != null) { super.setOutputStream(out); } else { largeMessageController.setOutputStream(out); } return this; }
/** * @param timeWait Milliseconds to Wait. 0 means forever */ @Override public synchronized boolean waitCompletion(final long timeWait) throws ActiveMQException { return bufferDelegate.waitCompletion(timeWait); }
@Override public void discardBody() { if (writableBuffer != null) { super.discardBody(); } else { largeMessageController.discardUnusedPackets(); } }
/** * Add a buff to the List, or save it to the OutputStream if set */ @Override public void addPacket(byte[] chunk, int flowControlSize, boolean isContinues) { bufferDelegate.addPacket(chunk, flowControlSize, isContinues); }
@Override public long getSize() { return this.bufferDelegate.getSize(); }
@Override public synchronized void cancel() { bufferDelegate.cancel(); }
@Override public void saveToOutputStream(final OutputStream out) throws ActiveMQException { if (writableBuffer != null) { // The body was rebuilt on the client, so we need to behave as a regular message on this case super.saveToOutputStream(out); } else { largeMessageController.saveBuffer(out); } }