示例#1
0
        public static ConsumerSubscriptionConfigurator <TConsumer> Consumer <TConsumer>(
            this SubscriptionBusServiceConfigurator configurator, IWindsorContainer container)
            where TConsumer : class
        {
            var consumerFactory = new WindsorConsumerFactory <TConsumer>(container);

            return(configurator.Consumer(consumerFactory));
        }
示例#2
0
        /// <summary>
        /// Register the type as a type to load from the container as a consumer.
        /// </summary>
        /// <typeparam name="T">The type of the consumer that consumes messages</typeparam>
        /// <param name="configurator">configurator</param>
        /// <param name="container">The container that the consumer should be loaded from.</param>
        /// <param name="configure"></param>
        /// <returns>The configurator</returns>
        public static void Consumer <T>(this IReceiveEndpointConfigurator configurator, IKernel container, Action <IConsumerConfigurator <T> > configure = null)
            where T : class, IConsumer
        {
            if (configurator == null)
            {
                throw new ArgumentNullException("configurator");
            }
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }

            var consumerFactory = new WindsorConsumerFactory <T>(container);

            configurator.Consumer(consumerFactory, configure);
        }
示例#3
0
        /// <summary>
        /// Register the type as a type to load from the container as a consumer.
        /// </summary>
        /// <typeparam name="TConsumer">The type of the consumer that consumes messages</typeparam>
        /// <param name="configurator">configurator</param>
        /// <param name="container">The container that the consumer should be loaded from.</param>
        /// <returns>The configurator</returns>
        public static ConsumerSubscriptionConfigurator <TConsumer> Consumer <TConsumer>(
            [NotNull] this SubscriptionBusServiceConfigurator configurator,
            [NotNull] IWindsorContainer container)
            where TConsumer : class
        {
            if (configurator == null)
            {
                throw new ArgumentNullException("configurator");
            }
            if (container == null)
            {
                throw new ArgumentNullException("container");
            }
            var consumerFactory = new WindsorConsumerFactory <TConsumer>(container);

            return(configurator.Consumer(consumerFactory));
        }