/// <summary> /// Initializes a new instance of the <see cref="HandlerConfiguration"/> class. /// We use the <see cref="IAmASubscriberRegistry"/> instance to look up subscribers for messages when dispatching. Use <see cref="SubscriberRegistry"/> unless /// you have some reason to override. We expect a <see cref="CommandProcessor.Send{T}(T)"/> to have one registered handler /// We use the /// </summary> /// <param name="subscriberRegistry">The subscriber registry.</param> /// <param name="handlerFactory">The handler factory.</param> /// <param name="asyncHandlerFactory">The async handler factory.</param> public HandlerConfiguration(IAmASubscriberRegistry subscriberRegistry, IAmAHandlerFactory handlerFactory, IAmAnAsyncHandlerFactory asyncHandlerFactory) { SubscriberRegistry = subscriberRegistry; HandlerFactory = handlerFactory; AsyncHandlerFactory = asyncHandlerFactory; }
public LifetimeScope(IAmAHandlerFactory handlerFactory, IAmAnAsyncHandlerFactory asyncHandlerFactory) :this(handlerFactory, asyncHandlerFactory, LogProvider.GetCurrentClassLogger()) {}
public LifetimeScope(IAmAHandlerFactory handlerFactory, IAmAnAsyncHandlerFactory asyncHandlerFactory, ILog logger) { _handlerFactory = handlerFactory; _asyncHandlerFactory = asyncHandlerFactory; _logger = logger; }
/// <summary> /// Supplies the specified handler configuration, so that we can register subscribers and the handler factory used to create instances of them /// </summary> /// <param name="handlerConfiguration">The handler configuration.</param> /// <returns>INeedPolicy.</returns> public INeedPolicy Handlers(HandlerConfiguration handlerConfiguration) { _registry = handlerConfiguration.SubscriberRegistry; _handlerFactory = handlerConfiguration.HandlerFactory; _asyncHandlerFactory = handlerConfiguration.AsyncHandlerFactory; return this; }