Exemple #1
0
 /// <summary>
 ///   添加Event和Heartbeat
 /// </summary>
 /// <param name="manager"> </param>
 /// <param name="message"> </param>
 public void Add(DefaultMessageManager manager, IMessage message)
 {
     if ((_mStack.Count == 0))
     {
         IMessageTree tree = _mTree.Copy();
         tree.MessageId = manager.NextMessageId();
         tree.Message   = message;
         manager.Flush(tree);
     }
     else
     {
         ITransaction entry = _mStack.Peek();
         entry.AddChild(message);
     }
 }
Exemple #2
0
        /// <summary>
        ///   添加transaction
        /// </summary>
        /// <param name="manager"> </param>
        /// <param name="transaction"> </param>
        public void Start(DefaultMessageManager manager, ITransaction transaction)
        {
            if (_mStack.Count != 0)
            {
                transaction.Standalone = false;
                ITransaction entry = _mStack.Peek();
                entry.AddChild(transaction);
            }
            else
            {
                _mTree.MessageId = manager.NextMessageId();
                _mTree.Message   = transaction;
            }

            _mStack.Push(transaction);
        }