public Mediator(ICommandReceivePipe <IReceiveContext <ICommand> > commandReceivePipe, IEventReceivePipe <IReceiveContext <IEvent> > eventReceivePipe, IRequestReceivePipe <IReceiveContext <IRequest> > requestPipe, IPublishPipe <IPublishContext <IEvent> > publishPipe, IGlobalReceivePipe <IReceiveContext <IMessage> > globalPipe, IDependancyScope scope = null) { _commandReceivePipe = commandReceivePipe; _eventReceivePipe = eventReceivePipe; _requestPipe = requestPipe; _publishPipe = publishPipe; _globalPipe = globalPipe; _scope = scope; }
public JobConfigurator(Type typeOfMapper, Type typeOfCombiner, Type typeOfReducer, Type typeOfDataBatchProcessor, int numberOfMappersPerNode = 0, int numberOfChunks = 4, IDependancyScope dependancyScope = null) { if (numberOfChunks == 0) { numberOfChunks = 4; } TypeOfMapper = typeOfMapper; TypeOfCombiner = typeOfCombiner; TypeOfReducer = typeOfReducer; TypeOfDataBatchProcessor = typeOfDataBatchProcessor; NumberOfMappersPerNode = numberOfMappersPerNode; NumberOfChunks = numberOfChunks; DependancyScope = dependancyScope; }
public JobConfigurator UseIoC(IDependancyScope scope) { DependancyScope = scope; return(this); }
public EventReceivePipeConfigurator(IDependancyScope resolver = null) { _resolver = resolver; _specifications = new List <IPipeSpecification <IReceiveContext <IEvent> > >(); }
public CommandReceivePipe(IPipeSpecification <TContext> specification, IPipe <TContext> next, IDependancyScope resolver = null) { _specification = specification; _resolver = resolver; Next = next; }
public GlobalRececivePipeConfigurator(IDependancyScope resolver = null) { _resolver = resolver; _specifications = new List <IPipeSpecification <IReceiveContext <IMessage> > >(); }
public RequestPipe(IPipeSpecification <TContext> specification, IPipe <TContext> next, IDependancyScope resolver) { Next = next; _specification = specification; _resolver = resolver; }
public PublishPipe(IPipeSpecification <TContext> specification, IPipe <TContext> next, IDependancyScope resolver = null) { Next = next; _specification = specification; _resolver = resolver; }
public IMediator Build(IDependancyScope scope) { IGlobalReceivePipe <IReceiveContext <IMessage> > globalReceivePipe; ICommandReceivePipe <IReceiveContext <ICommand> > commandReceivePipe; IEventReceivePipe <IReceiveContext <IEvent> > eventReceivePipe; IRequestReceivePipe <IReceiveContext <IRequest> > requestPipe; IPublishPipe <IPublishContext <IEvent> > publishPipe; var receivePipeConfigurator = new CommandReceivePipeConfigurator(scope); if (_commandReceivePipeConfiguratorAction == null) { commandReceivePipe = receivePipeConfigurator.Build(); } else { _commandReceivePipeConfiguratorAction(receivePipeConfigurator); commandReceivePipe = receivePipeConfigurator.Build(); } var eventReceivePipeConfigurator = new EventReceivePipeConfigurator(scope); if (_eventReceivePipeConfiguratorAction == null) { eventReceivePipe = eventReceivePipeConfigurator.Build(); } else { _eventReceivePipeConfiguratorAction(eventReceivePipeConfigurator); eventReceivePipe = eventReceivePipeConfigurator.Build(); } var requestPipeConfigurator = new RequestPipeConfigurator(scope); if (_requestPipeConfiguratorAction == null) { requestPipe = requestPipeConfigurator.Build(); } else { _requestPipeConfiguratorAction(requestPipeConfigurator); requestPipe = requestPipeConfigurator.Build(); } var publishPipeConfigurator = new PublishPipeConfigurator(scope); if (_publishPipeConfiguratorAction == null) { publishPipe = publishPipeConfigurator.Build(); } else { _publishPipeConfiguratorAction(publishPipeConfigurator); publishPipe = publishPipeConfigurator.Build(); } var globalPipeConfigurator = new GlobalRececivePipeConfigurator(scope); if (_globalReceivePipeConfiguratorAction == null) { globalReceivePipe = globalPipeConfigurator.Build(); } else { _globalReceivePipeConfiguratorAction(globalPipeConfigurator); globalReceivePipe = globalPipeConfigurator.Build(); } return(new Mediator(commandReceivePipe, eventReceivePipe, requestPipe, publishPipe, globalReceivePipe, scope)); }