Example #1
0
        public MessageInterceptor Create(Action beforeConsume, Action afterConsume)
        {
            var scope = new MessageInterceptorConfiguratorScope();

            _sink.Inspect(scope);

            return(ConfigureFilter(scope.InsertAfter, beforeConsume, afterConsume));
        }
Example #2
0
        public OutboundMessageInterceptor Create(IOutboundMessageInterceptor messageInterceptor)
        {
            var scope = new OutboundMessageInterceptorConfiguratorScope();

            _sink.Inspect(scope);

            return(ConfigureInterceptor(scope.InsertAfter, messageInterceptor));
        }
        public MessageRouter <IConsumeContext <TOutput> > FindOrCreate <TOutput>()
            where TOutput : class
        {
            var scope = new InboundMessageRouterConfiguratorScope <IConsumeContext <TOutput> >();

            _sink.Inspect(scope);

            return(scope.OutputRouter ?? ConfigureRouter <TOutput>(scope.InputRouter));
        }
Example #4
0
        public static void Trace <T>(IPipelineSink <T> pipeline, Action <string> callback)
            where T : class
        {
            var viewer = new PipelineViewer();

            pipeline.Inspect(viewer);

            callback(viewer.Text);
        }
Example #5
0
        public static void Trace <T>(IPipelineSink <T> pipeline)
            where T : class
        {
            var viewer = new PipelineViewer();

            pipeline.Inspect(viewer);

            System.Diagnostics.Trace.WriteLine(viewer.Text);
        }
        public MessageFilter <TMessage> Create <TMessage>(string description, Func <TMessage, bool> allow)
            where TMessage : class
        {
            EnsureRouterExists <TMessage>(_sink);

            var scope = new MessageFilterConfiguratorScope <TMessage>();

            _sink.Inspect(scope);

            return(ConfigureFilter(description, scope.InsertAfter, allow));
        }
        public RequestMessageRouter <IConsumeContext <TMessage>, TMessage> FindOrCreate <TMessage>()
            where TMessage : class
        {
            var configurator = new InboundMessageRouterConfigurator(_sink);

            MessageRouter <IConsumeContext <TMessage> > router = configurator.FindOrCreate <TMessage>();

            var scope = new InboundRequestMessageRouterConfiguratorScope <TMessage>();

            _sink.Inspect(scope);

            return(scope.Router ?? ConfigureRouter(router));
        }
Example #8
0
        public CorrelatedMessageRouter <IConsumeContext <TMessage>, TMessage, TKey> FindOrCreate <TMessage, TKey>()
            where TMessage : class, CorrelatedBy <TKey>
        {
            var configurator = new InboundMessageRouterConfigurator(_sink);

            MessageRouter <IConsumeContext <TMessage> > router = configurator.FindOrCreate <TMessage>();

            var scope = new InboundCorrelatedMessageRouterConfiguratorScope <TMessage, TKey>();

            _sink.Inspect(scope);

            return(scope.Router ?? ConfigureRouter <TMessage, TKey>(router));
        }
        public MessageRouter <TMessage> FindOrCreate <TMessage>()
            where TMessage : class
        {
            var scope = new MessageRouterConfiguratorScope <TMessage>();

            if (_sink != null)
            {
                _sink.Inspect(scope);
            }
            else if (_typedSink != null)
            {
                _typedSink.TranslateTo <IPipelineSink <TMessage> >().Inspect(scope);
            }

            return(scope.Router ?? ConfigureRouter <TMessage>(scope.ObjectRouter));
        }
Example #10
0
 public bool Inspect(IPipelineInspector inspector)
 {
     return(inspector.Inspect(this) && _output.Inspect(inspector));
 }
Example #11
0
 public bool Inspect(IPipelineInspector inspector)
 {
     return(inspector.Inspect(this, () => _sink.Inspect(inspector)));
 }