コード例 #1
0
        public ProducerState removeProducer(ProducerId id)
        {
            ProducerState ret = producers[id];

            producers.Remove(id);
            return(ret);
        }
コード例 #2
0
ファイル: TransactionState.cs プロジェクト: USC-ICT/elsender
 public void AddProducer(ProducerState producer)
 {
     CheckShutdown();
     if (this.producers.ContainsKey(producer.Info.ProducerId))
     {
         this.producers[producer.Info.ProducerId] = producer;
     }
     else
     {
         this.producers.Add(producer.Info.ProducerId, producer);
     }
 }
コード例 #3
0
ファイル: SessionState.cs プロジェクト: USC-ICT/elsender
        public void AddProducer(ProducerInfo info)
        {
            CheckShutdown();
            ProducerState producerState = new ProducerState(info);

            if (producers.ContainsKey(info.ProducerId))
            {
                producers[info.ProducerId] = producerState;
            }
            else
            {
                producers.Add(info.ProducerId, producerState);
            }
        }
コード例 #4
0
ファイル: SessionState.cs プロジェクト: USC-ICT/elsender
        public ProducerState RemoveProducer(ProducerId id)
        {
            CheckShutdown();
            ProducerState ret = null;

            if (producers.TryGetValue(id, out ret))
            {
                producers.Remove(id);
                if (null != ret && ret.TransactionState != null)
                {
                    ret.TransactionState.AddProducer(ret);
                }
            }

            return(ret);
        }
コード例 #5
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);
        }