Apache.NMS.ActiveMQ.Transport.ResponseCorrelator.OnCommand C# (CSharp) Method

OnCommand() protected method

protected OnCommand ( ITransport sender, Command command ) : void
sender ITransport
command Command
return void
        protected override void OnCommand(ITransport sender, Command command)
        {
            if(command.IsResponse)
            {
                Response response = (Response) command;
                int correlationId = response.CorrelationId;
                FutureResponse future = (FutureResponse) requestMap[correlationId];

                if(future != null)
                {
                    requestMap.Remove(correlationId);
                    future.Response = response;

                    if(response is ExceptionResponse)
                    {
                        ExceptionResponse er = response as ExceptionResponse;
                        BrokerError brokerError = er.Exception;
                        BrokerException exception = new BrokerException(brokerError);
                        this.exceptionHandler(this, exception);
                    }
                }
                else
                {
                    if(Tracer.IsDebugEnabled)
                    {
                        Tracer.Debug("Unknown response ID: " + response.CommandId + " for response: " + response);
                    }
                }
            }
            else
            {
                this.commandHandler(sender, command);
            }
        }