void Execute <T>(BehaviorChain <T> pipelineAction, T context) where T : BehaviorContext { try { contextStacker.Push(context); pipelineAction.Invoke(); } finally { contextStacker.Pop(); } }
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); }