Exemplo n.º 1
0
 /// <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;
 }
Exemplo n.º 2
0
 /// <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;
     return this;
 }