Search in sources :

Example 1 with ResetLimitWrappedActiveMQBuffer

use of org.apache.activemq.artemis.core.buffers.impl.ResetLimitWrappedActiveMQBuffer in project activemq-artemis by apache.

the class CoreMessage method internalWritableBuffer.

private void internalWritableBuffer() {
    if (writableBuffer == null) {
        writableBuffer = new ResetLimitWrappedActiveMQBuffer(BODY_OFFSET, buffer.duplicate(), this);
        if (endOfBodyPosition > 0) {
            writableBuffer.byteBuf().setIndex(BODY_OFFSET, endOfBodyPosition - BUFFER_HEADER_SPACE + BODY_OFFSET);
            writableBuffer.resetReaderIndex();
        }
    }
}
Also used : ResetLimitWrappedActiveMQBuffer(org.apache.activemq.artemis.core.buffers.impl.ResetLimitWrappedActiveMQBuffer)

Example 2 with ResetLimitWrappedActiveMQBuffer

use of org.apache.activemq.artemis.core.buffers.impl.ResetLimitWrappedActiveMQBuffer in project activemq-artemis by apache.

the class JMSMappingOutboundTransformerTest method newMessage.

private CoreMessage newMessage(byte messageType) {
    CoreMessage message = new CoreMessage(0, 512);
    message.setType(messageType);
    ((ResetLimitWrappedActiveMQBuffer) message.getBodyBuffer()).setMessage(null);
    return message;
}
Also used : CoreMessage(org.apache.activemq.artemis.core.message.impl.CoreMessage) ResetLimitWrappedActiveMQBuffer(org.apache.activemq.artemis.core.buffers.impl.ResetLimitWrappedActiveMQBuffer)

Example 3 with ResetLimitWrappedActiveMQBuffer

use of org.apache.activemq.artemis.core.buffers.impl.ResetLimitWrappedActiveMQBuffer in project activemq-artemis by apache.

the class ClientLargeMessageImpl method checkBuffer.

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));
    }
}
Also used : ResetLimitWrappedActiveMQBuffer(org.apache.activemq.artemis.core.buffers.impl.ResetLimitWrappedActiveMQBuffer)

Aggregations

ResetLimitWrappedActiveMQBuffer (org.apache.activemq.artemis.core.buffers.impl.ResetLimitWrappedActiveMQBuffer)3 CoreMessage (org.apache.activemq.artemis.core.message.impl.CoreMessage)1