Exemple #1
0
        protected virtual void AfterMethodExecution(MethodInfo methodInfo)
        {
            IPersistenceConversationInfo att = Metadata.GetConversationInfoFor(methodInfo);
            var cca = ConversationsContainerAccessor;

            if (att == null || cca == null)
            {
                return;
            }
            IConversation c = cca.Container.Get(conversationId);

            switch (att.ConversationEndMode)
            {
            case EndMode.End:
                c.End();
                c.Dispose();
                break;

            case EndMode.Abort:
                c.Abort();
                c.Dispose();
                break;

            case EndMode.CommitAndContinue:
                c.FlushAndPause();
                break;

            case EndMode.DoNothing:
                break;

            default:
                c.Pause();
                break;
            }
        }
Exemple #2
0
        protected void EndPersistenceConversation()
        {
            IConversation c = cca.Container.Get(GetConvesationId());

            if (c != null)
            {
                c.Resume();
                c.End();
            }
        }
Exemple #3
0
            public void Dispose()
            {
                IConversation c = pcm.cca.Container.Get(pcm.GetConvesationId());

                switch (endMode)
                {
                case ConversationEndMode.End:
                    c.End();
                    break;

                case ConversationEndMode.Abort:
                    c.Dispose();
                    break;

                default:
                    c.Pause();
                    break;
                }
            }
Exemple #4
0
        public void OnSuccess(MethodExecutionArgs eventArgs)
        {
            if (IsNoopConversationalMarkerActive)
            {
                return;
            }
            if (eventArgs.MethodExecutionTag == NestedMethodMarker)
            {
                return;
            }
            IConversationsContainerAccessor cca = ConversationsContainerAccessor;
            IConversation c = cca.Container.Get(GetConversationIdMethod.Invoke());

            EndMode endMode = GetMethodEndMode(eventArgs.Method);

            switch (endMode)
            {
            case EndMode.End:
                c.End();
                c.Dispose();
                break;

            case EndMode.Abort:
                c.Abort();
                c.Dispose();
                break;

            case EndMode.CommitAndContinue:
                c.FlushAndPause();
                break;

            default:
                c.Pause();
                break;
            }
        }