示例#1
0
 void Execute <T>(BehaviorChain <T> pipelineAction, T context) where T : BehaviorContext
 {
     try
     {
         contextStacker.Push(context);
         pipelineAction.Invoke();
     }
     finally
     {
         contextStacker.Pop();
     }
 }
示例#2
0
        public void InvokeReceivePhysicalMessagePipeline()
        {
            var context = contextStacker.Current as ReceivePhysicalMessageContext;

            if (context == null)
            {
                throw new InvalidOperationException("Can't invoke the receive pipeline when the current context is: " + contextStacker.Current.GetType().Name);
            }


            var pipeline = new BehaviorChain <ReceivePhysicalMessageContext>(pipelineBuilder.receivePhysicalMessageBehaviorList);


            pipeline.Invoke(context);
        }