Esempio n. 1
0
        public static ICommandProcessorConfiguration RegisterCommandHandlers(this ICommandProcessorConfiguration configuration, ISessionMessagePump receiver, params Type[] types)
        {
            configuration.RegisterCommandHandlers(receiver, new ArrayMessageHandlerRegistration <ICommandHandler>(typeof(ICommandHandler <>), types));

            // Continue.
            return(configuration);
        }
Esempio n. 2
0
        public static ICommandProcessorConfiguration RegisterCommandHandlers(this ICommandProcessorConfiguration configuration, ISessionMessagePump receiver, Action <IFluentMessageHandlerRegistration <ICommandHandler> > config)
        {
            // Create configuration object and call external configuration.
            var handlers = new FluentMessageHandlerRegistration <ICommandHandler>(typeof(ICommandHandler <>));

            config(handlers);

            // Register handlers.
            configuration.RegisterCommandHandlers(receiver, handlers);

            // Continue.
            return(configuration);
        }
Esempio n. 3
0
        public static ICommandProcessorConfiguration RegisterCommandHandler <TCommandHandler>(this ICommandProcessorConfiguration configuration, ISessionMessagePump receiver)
            where TCommandHandler : ICommandHandler
        {
            configuration.RegisterCommandHandlers(receiver, new TypeMessageHandlerRegistration <ICommandHandler>(typeof(ICommandHandler <>), typeof(TCommandHandler)));

            // Continue.
            return(configuration);
        }
 public CommandProcessor(ICommandProcessorConfiguration configuration)
 {
     commandModuleCatalog           = configuration.CommandModuleCatalog;
     compiledCommandHandlerPipeline = configuration.CompiledCommandHandlerPipeline;
     scopedInstanceFactoryFactory   = configuration.ScopedInstanceFactoryFactory;
 }