private void RegisterHandlerMethodOnListenedChannel(StreamListenerMethodValidator streamListenerMethod, StreamListenerAttribute streamListener, Type implementation)
        {
            if (string.IsNullOrEmpty(streamListener.Target))
            {
                throw new ArgumentException("The binding target name cannot be null");
            }

            var method = streamListenerMethod.Method;

            var defaultOutputChannel = streamListenerMethod.GetOutboundBindingTargetName();

            if (typeof(void).Equals(method.ReturnType))
            {
                if (!string.IsNullOrEmpty(defaultOutputChannel))
                {
                    throw new ArgumentException("An output channel cannot be specified for a method that does not return a value");
                }
            }
            else
            {
                if (string.IsNullOrEmpty(defaultOutputChannel))
                {
                    throw new ArgumentException("An output channel must be specified for a method that can return a value");
                }
            }

            streamListenerMethod.ValidateStreamListenerMessageHandler();

            _processor.AddMappedListenerMethod(streamListener.Target, new StreamListenerHandlerMethodMapping(implementation, method, streamListener.Condition, defaultOutputChannel, streamListener.CopyHeaders));
        }
        public override void OrchestrateStreamListener(StreamListenerAttribute streamListener, MethodInfo method, Type implementation)
        {
            var methodAnnotatedInboundName = streamListener.Target;

            var streamListenerMethod = new StreamListenerMethodValidator(method, _context, _streamListenerParameterAdapters);

            streamListenerMethod.Validate(methodAnnotatedInboundName, streamListener.Condition);

            var isDeclarative = streamListenerMethod.CheckDeclarativeMethod(methodAnnotatedInboundName);

            if (isDeclarative)
            {
                var methodAnnotatedOutboundName = streamListenerMethod.GetOutboundBindingTargetName();
                var adaptedInboundArguments     = AdaptAndRetrieveInboundArguments(method, methodAnnotatedInboundName, _streamListenerParameterAdapters.ToArray());
                InvokeStreamListenerResultAdapter(method, implementation, methodAnnotatedOutboundName, adaptedInboundArguments);
            }
            else
            {
                RegisterHandlerMethodOnListenedChannel(streamListenerMethod, streamListener, implementation);
            }
        }