public void Add(Guid key, AbstractConversation value)
        {
            CheckGuid(key);
            lock (this)
            {
                if (pool.ContainsKey(key))
                {
                    throw new ArgumentException(
                        "this key has been used and thus cannot be used to add conversation to the pool");
                }

                CleanUpTimeoutConversation();
                pool[key] = new ConversationPoolItem(value);
            }
        }
        public void Add(Guid key, AbstractConversation value)
        {
            CheckGuid(key);
            lock (this)
            {
                if (pool.ContainsKey(key))
                {
                    throw new ArgumentException(
                              "this key has been used and thus cannot be used to add conversation to the pool");
                }

                CleanUpTimeoutConversation();
                pool[key] = new ConversationPoolItem(value);
            }
        }
Example #3
0
        /// <summary>
        /// create a workspace in which transaction is automatically managed and has the same life cycle as conversation
        /// </summary>
        /// <param name="states"></param>
        /// <param name="currentWorkSpaceName"></param>
        /// <returns></returns>
        public static WorkSpace Create(NameValueCollection states, string currentWorkSpaceName)
        {
            string cid = GetWorkSpaceState(states, ConversationIdKeyName, currentWorkSpaceName);

            if (!string.IsNullOrEmpty(cid))
            {
                AbstractConversation c = ConversationPool.Instance[new Guid(cid)];
                c.Reconnect();
                return(new WorkSpace(c));
            }
            else
            {
                AbstractConversation c =
                    new BurrowFramework().BurrowEnvironment.Configuration.ManualTransactionManagement ?
                    (AbstractConversation) new ConversationWithManualTransactionImpl() : new ConversationWithManagedTransactionImpl();
                return(new WorkSpace(c));
            }
        }
Example #4
0
 private WorkSpace(AbstractConversation c)
 {
     c.Closed += new EventHandler(conversation_Closed);
     conversation = c;
 }
Example #5
0
 private void conversation_Closed(object sender, EventArgs e)
 {
     conversation = null;
     Close();
 }
Example #6
0
 private WorkSpace(AbstractConversation c)
 {
     c.Closed    += new EventHandler(conversation_Closed);
     conversation = c;
 }
Example #7
0
 private void conversation_Closed(object sender, EventArgs e)
 {
     conversation = null;
     Close();
 }
 public ConversationPoolItem(AbstractConversation conversation)
 {
     this.conversation = conversation;
 }
 public ConversationPoolItem(AbstractConversation conversation)
 {
     this.conversation = conversation;
 }