Example #1
0
        public override Response ProcessBeginTransaction(TransactionInfo info)
        {
            if (TrackTransactions && info != null && info.TransactionId != null)
            {
                ConnectionId connectionId = info.ConnectionId;
                if (connectionId != null)
                {
                    ConnectionState cs = null;

                    if (connectionStates.TryGetValue(connectionId, out cs))
                    {
                        cs.AddTransactionState(info.TransactionId);
                        TransactionState state = cs[info.TransactionId];
                        state.AddCommand(info);
                    }
                }
                return(TRACKED_RESPONSE_MARKER);
            }
            return(null);
        }
Example #2
0
 public override Response processEndTransaction(TransactionInfo info)
 {
     if (TrackTransactions && info != null)
     {
         ConnectionId connectionId = info.ConnectionId;
         if (connectionId != null)
         {
             ConnectionState cs = connectionStates[connectionId];
             if (cs != null)
             {
                 TransactionState transactionState = cs[info.TransactionId];
                 if (transactionState != null)
                 {
                     transactionState.addCommand(info);
                 }
             }
         }
         return(TRACKED_RESPONSE_MARKER);
     }
     return(null);
 }
Example #3
0
 public override Response processRollbackTransaction(TransactionInfo info)
 {
     if (TrackTransactions && info != null)
     {
         ConnectionId connectionId = info.ConnectionId;
         if (connectionId != null)
         {
             ConnectionState cs = connectionStates[connectionId];
             if (cs != null)
             {
                 TransactionState transactionState = cs[info.TransactionId];
                 if (transactionState != null)
                 {
                     transactionState.addCommand(info);
                     return(new Tracked(new RemoveTransactionAction(info, this)));
                 }
             }
         }
     }
     return(null);
 }
Example #4
0
 public override Response processMessageAck(MessageAck ack)
 {
     if (TrackTransactions && ack != null && ack.TransactionId != null)
     {
         ConnectionId connectionId = ack.ConsumerId.ParentId.ParentId;
         if (connectionId != null)
         {
             ConnectionState cs = connectionStates[connectionId];
             if (cs != null)
             {
                 TransactionState transactionState = cs[ack.TransactionId];
                 if (transactionState != null)
                 {
                     transactionState.addCommand(ack);
                 }
             }
         }
         return(TRACKED_RESPONSE_MARKER);
     }
     return(null);
 }
Example #5
0
        public override Response ProcessCommitTransactionTwoPhase(TransactionInfo info)
        {
            if (TrackTransactions && info != null)
            {
                ConnectionId connectionId = info.ConnectionId;
                if (connectionId != null)
                {
                    ConnectionState cs = null;

                    if (connectionStates.TryGetValue(connectionId, out cs))
                    {
                        TransactionState transactionState = cs[info.TransactionId];
                        if (transactionState != null)
                        {
                            transactionState.AddCommand(info);
                            return(new Tracked(new RemoveTransactionAction(info, this)));
                        }
                    }
                }
            }
            return(null);
        }
        public override Response processPrepareTransaction(TransactionInfo info)
        {
            if (TrackTransactions && info != null)
            {
                ConnectionId connectionId = info.ConnectionId;
                if (connectionId != null)
                {
                    ConnectionState cs = null;

                    if (connectionStates.TryGetValue(connectionId, out cs))
                    {
                        TransactionState transactionState = cs[info.TransactionId];
                        if (transactionState != null)
                        {
                            transactionState.addCommand(info);
                        }
                    }
                }
                return(TRACKED_RESPONSE_MARKER);
            }
            return(null);
        }
Example #7
0
        public override Response ProcessMessage(Message send)
        {
            if (send != null)
            {
                if (TrackTransactions && send.TransactionId != null)
                {
                    ProducerId   producerId   = send.ProducerId;
                    ConnectionId connectionId = producerId.ParentId.ParentId;
                    if (connectionId != null)
                    {
                        ConnectionState cs = null;

                        if (connectionStates.TryGetValue(connectionId, out cs))
                        {
                            TransactionState transactionState = cs[send.TransactionId];
                            if (transactionState != null)
                            {
                                transactionState.AddCommand(send);

                                if (isTrackTransactionProducers)
                                {
                                    SessionState  ss            = cs[producerId.ParentId];
                                    ProducerState producerState = ss[producerId];
                                    producerState.TransactionState = transactionState;
                                }
                            }
                        }
                    }
                    return(TRACKED_RESPONSE_MARKER);
                }
                else if (TrackMessages)
                {
                    messageCache.Add(send.MessageId, (Message)send.Clone());
                }
            }
            return(null);
        }