예제 #1
0
        public bool Inspect <TMessage>(EndpointMessageSink <TMessage> sink)
            where TMessage : class
        {
            Append(string.Format("Send {0} to Endpoint {1}", GetMessageName <TMessage>(), sink.Endpoint.Address.Uri));

            return(true);
        }
예제 #2
0
        /// <summary>
        /// Connects an endpoint to the outbound pipeline by message type.
        /// </summary>
        /// <typeparam name="TMessage">The type of the message to route</typeparam>
        /// <param name="pipeline">The outbound pipeline</param>
        /// <param name="endpoint">The endpoint to route to</param>
        /// <returns></returns>
        public static UnsubscribeAction ConnectEndpoint <TMessage>(this IOutboundMessagePipeline pipeline, IEndpoint endpoint)
            where TMessage : class
        {
            var sink = new EndpointMessageSink <TMessage>(endpoint);

            return(pipeline.ConnectToRouter(sink));
        }
예제 #3
0
        public bool Inspect <TMessage>(EndpointMessageSink <TMessage> sink) where TMessage : class
        {
            if (typeof(TMessage) == _messageType)
            {
                DestinationAddress = sink.Endpoint.Address.Uri;
                return(false);
            }

            return(true);
        }
예제 #4
0
        void CreateEndpointSink <TMessage>(IEndpoint endpoint)
            where TMessage : class
        {
            var endpointSink = new EndpointMessageSink <TMessage>(endpoint);

            var filterSink = new OutboundMessageFilter <TMessage>(endpointSink,
                                                                  context => context.DeclaringMessageType == typeof(TMessage));

            UnsubscribeAction unsubscribeAction = _bus.OutboundPipeline.ConnectToRouter(filterSink);

            _added.Add(typeof(TMessage), unsubscribeAction);
        }
예제 #5
0
        /// <summary>
        /// Called by the reflective visitor base.
        /// </summary>
        public bool Inspect <TMessage>(EndpointMessageSink <TMessage> sink)
            where TMessage : class
        {
            if (typeof(TMessage) == _messageType && _endpointAddress.Uri == sink.Endpoint.Address.Uri)
            {
                Found = true;

                return(false);
            }

            return(true);
        }
예제 #6
0
        public bool Inspect <TMessage>(EndpointMessageSink <TMessage> sink)
            where TMessage : class
        {
            if (typeof(TMessage) == typeof(T))
            {
                Result = Result.Concat(new[] { sink as IPipelineSink <T> });

                return(false);
            }

            return(true);
        }
예제 #7
0
        public bool Inspect <TMessage>(EndpointMessageSink <TMessage> sink) where TMessage : class
        {
            Append(string.Format("Send {0} to Endpoint {1}", typeof(TMessage).Name, sink.Address));

            return(true);
        }