Exemple #1
0
 /// <summary>
 /// The <see cref="CommandProcessor"/> wants to support <see cref="CommandProcessor.Post{T}(T)"/> or <see cref="CommandProcessor.Repost"/> using Task Queues.
 /// You need to provide a policy to specify how QoS issues, specifically <see cref="CommandProcessor.RETRYPOLICY "/> or <see cref="CommandProcessor.CIRCUITBREAKER "/>
 /// are handled by adding appropriate <see cref="Policies"/> when choosing this option.
 ///
 /// </summary>
 /// <param name="configuration">The Task Queues configuration.</param>
 /// <returns>INeedARequestContext.</returns>
 public INeedARequestContext TaskQueues(MessagingConfiguration configuration)
 {
     messageStore          = configuration.MessageStore;
     messagingGateway      = configuration.MessagingGateway;
     messageMapperRegistry = configuration.MessageMapperRegistry;
     return(this);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MessagingConfiguration"/> class.
 /// </summary>
 /// <param name="messageStore">The message store.</param>
 /// <param name="messagingGateway">The messaging gateway.</param>
 /// <param name="messageMapperRegistry">The message mapper registry.</param>
 public MessagingConfiguration(
     IAmAMessageStore <Message> messageStore,
     IAmAClientRequestHandler messagingGateway,
     IAmAMessageMapperRegistry messageMapperRegistry
     )
 {
     MessageStore          = messageStore;
     MessagingGateway      = messagingGateway;
     MessageMapperRegistry = messageMapperRegistry;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CommandProcessor"/> class.
 /// Use this constructor when both task queue and command processor support is required
 /// </summary>
 /// <param name="subscriberRegistry">The subscriber registry.</param>
 /// <param name="handlerFactory">The handler factory.</param>
 /// <param name="requestContextFactory">The request context factory.</param>
 /// <param name="policyRegistry">The policy registry.</param>
 /// <param name="mapperRegistry">The mapper registry.</param>
 /// <param name="messageStore">The message store.</param>
 /// <param name="messagingGateway">The messaging gateway.</param>
 /// <param name="logger">The logger.</param>
 public CommandProcessor(
     IAmASubscriberRegistry subscriberRegistry,
     IAmAHandlerFactory handlerFactory,
     IAmARequestContextFactory requestContextFactory,
     IAmAPolicyRegistry policyRegistry,
     IAmAMessageMapperRegistry mapperRegistry,
     IAmAMessageStore <Message> messageStore,
     IAmAClientRequestHandler messagingGateway,
     ILog logger)
     : this(subscriberRegistry, handlerFactory, requestContextFactory, policyRegistry, logger)
 {
     this.mapperRegistry   = mapperRegistry;
     this.messageStore     = messageStore;
     this.messagingGateway = messagingGateway;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CommandProcessor"/> class.
 /// Use this constructor when only task queue support is required
 /// </summary>
 /// <param name="requestContextFactory">The request context factory.</param>
 /// <param name="policyRegistry">The policy registry.</param>
 /// <param name="mapperRegistry">The mapper registry.</param>
 /// <param name="messageStore">The message store.</param>
 /// <param name="messagingGateway">The messaging gateway.</param>
 /// <param name="logger">The logger.</param>
 public CommandProcessor(
     IAmARequestContextFactory requestContextFactory,
     IAmAPolicyRegistry policyRegistry,
     IAmAMessageMapperRegistry mapperRegistry,
     IAmAMessageStore <Message> messageStore,
     IAmAClientRequestHandler messagingGateway,
     ILog logger)
 {
     this.requestContextFactory = requestContextFactory;
     this.policyRegistry        = policyRegistry;
     this.logger           = logger;
     this.mapperRegistry   = mapperRegistry;
     this.messageStore     = messageStore;
     this.messagingGateway = messagingGateway;
 }