All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.rabbitmq.jms.client.RMQNullMessage Maven / Gradle / Ivy

There is a newer version: 3.4.0
Show newest version
package com.rabbitmq.jms.client;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;

import javax.jms.JMSException;
import javax.jms.Message;


class RMQNullMessage extends RMQMessage {

    // there is no body

    @Override
    protected void clearBodyInternal() throws JMSException {
        // no-op
    }

    @Override
    protected void writeBody(ObjectOutput out, ByteArrayOutputStream bout) throws IOException {
        // no-op
    }

    @Override
    protected void writeAmqpBody(ByteArrayOutputStream out) throws IOException {
        // no-op
    }

    @Override
    protected void readBody(ObjectInput inputStream, ByteArrayInputStream bin) throws IOException,
                                                                              ClassNotFoundException {
        // no-op
    }

    @Override
    protected void readAmqpBody(byte[] barr) {
        // no-op
    }

    public static final RMQMessage recreate(Message msg) throws JMSException {
        RMQNullMessage rmqNMsg = new RMQNullMessage();
        RMQMessage.copyAttributes(rmqNMsg, msg);
        return rmqNMsg;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy