Search in sources :

Example 1 with TransmitCallback

use of org.apache.activemq.transport.TransmitCallback in project activemq-artemis by apache.

the class OpenWireConnection method processDispatch.

protected void processDispatch(Command command) throws IOException {
    MessageDispatch messageDispatch = (MessageDispatch) (command.isMessageDispatch() ? command : null);
    try {
        if (!stopping.get()) {
            if (messageDispatch != null) {
                protocolManager.preProcessDispatch(messageDispatch);
            }
            dispatch(command);
        }
    } catch (IOException e) {
        if (messageDispatch != null) {
            TransmitCallback sub = messageDispatch.getTransmitCallback();
            protocolManager.postProcessDispatch(messageDispatch);
            if (sub != null) {
                sub.onFailure();
            }
            messageDispatch = null;
            throw e;
        }
    } finally {
        if (messageDispatch != null) {
            TransmitCallback sub = messageDispatch.getTransmitCallback();
            protocolManager.postProcessDispatch(messageDispatch);
            if (sub != null) {
                sub.onSuccess();
            }
        }
    }
}
Also used : MessageDispatch(org.apache.activemq.command.MessageDispatch) TransmitCallback(org.apache.activemq.transport.TransmitCallback) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 MessageDispatch (org.apache.activemq.command.MessageDispatch)1 TransmitCallback (org.apache.activemq.transport.TransmitCallback)1