public BaseModule(IEventBus eventBus, Services.IGlobalSettingsService globalSettingsService, string modulePath, bool verifyConfigured) : base(modulePath) { EventBus = eventBus; GlobalSettingsService = globalSettingsService; WireSetupPipeline(verifyConfigured); }
public InPlaceCompilingStoryRunner(IRemoteHandlerFactory factory, IScenarioPreprocessor preprocessor, IStoryFilter filter, ISessionContext context, IEventBus eventBus) { _factory = factory; _preprocessor = preprocessor; _filter = filter; _eventBus = eventBus; }
public ExclusiveConsumer( IQueue queue, Func<byte[], MessageProperties, MessageReceivedInfo, Task> onMessage, IPersistentConnection connection, IConsumerConfiguration configuration, IInternalConsumerFactory internalConsumerFactory, IEventBus eventBus ) { Preconditions.CheckNotNull(queue, "queue"); Preconditions.CheckNotNull(onMessage, "onMessage"); Preconditions.CheckNotNull(connection, "connection"); Preconditions.CheckNotNull(internalConsumerFactory, "internalConsumerFactory"); Preconditions.CheckNotNull(eventBus, "eventBus"); Preconditions.CheckNotNull(configuration, "configuration"); this.queue = queue; this.onMessage = onMessage; this.connection = connection; this.configuration = configuration; this.internalConsumerFactory = internalConsumerFactory; this.eventBus = eventBus; timer = new Timer(s => { StartConsumer(); ((Timer)s).Change(10000, -1); }); timer.Change(10000, -1); }
public GlobalSettingsProvider( IToolsOptionsPageProvider visualStudioPackageProvider, IEventBus eventBus) { _visualStudioPackageProvider = visualStudioPackageProvider; _eventBus = eventBus; _globalSettings = new Lazy<GlobalSettings>(CreateGlobalSettings); }
public MongoEventStore(IMongoConfiguration mongoConfiguration, IEventBus eventBus) : base(eventBus) { _server = MongoServer.Create(mongoConfiguration.Url); var mongoDatabaseSettings = _server.CreateDatabaseSettings(mongoConfiguration.DatabaseName); _database = _server.GetDatabase(mongoDatabaseSettings); }
protected void Application_Start() { Database.DefaultConnectionFactory = new ServiceConfigurationSettingConnectionFactory(Database.DefaultConnectionFactory); AreaRegistration.RegisterAllAreas(); Database.SetInitializer<ConferenceContext>(null); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); var serializer = new JsonTextSerializer(); #if LOCAL EventBus = new EventBus(new MessageSender(Database.DefaultConnectionFactory, "SqlBus", "SqlBus.Events"), serializer); #else var settings = InfrastructureSettings.ReadMessaging(HttpContext.Current.Server.MapPath(@"~\bin\Settings.xml")); EventBus = new EventBus(new TopicSender(settings, "conference/events"), new MetadataProvider(), serializer); #endif if (Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.IsAvailable) { System.Diagnostics.Trace.Listeners.Add(new Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener()); System.Diagnostics.Trace.AutoFlush = true; } }
public void Setup() { // // observers SystemObserver.Setup(new IObserver<ISystemEvent>[] { new ConsoleObserver() }); // // message router Router = new MemoryMessageRouter(); Router.RegisterHandler<CreateAccount>(new CreateAccountHandler().Handle); Router.RegisterHandler<AccountCreated>(new AccountCreatedHandler().Handle); // // message bus var bus = new NullBus(); CommandBus = bus; EventBus = bus; // // Queue Writer var queueWriter = new QueueWriterToBus(bus); // // Misc Sender = new MessageSender(new IQueueWriter[] { queueWriter }); Identifier = new AccountID(Guid.NewGuid()); }
public SourceExplorerHierarchyControllerFactory( ISynchronizationContextProvider synchronizationContextProvider, IFileSystemTreeSource fileSystemTreeSource, IVisualStudioPackageProvider visualStudioPackageProvider, IVsGlyphService vsGlyphService, IImageSourceFactory imageSourceFactory, IOpenDocumentHelper openDocumentHelper, IFileSystem fileSystem, IClipboard clipboard, IWindowsExplorer windowsExplorer, IUIRequestProcessor uiRequestProcessor, IEventBus eventBus, IGlobalSettingsProvider globalSettingsProvider, IDelayedOperationProcessor delayedOperationProcessor, IUIThread uiThread) { _synchronizationContextProvider = synchronizationContextProvider; _fileSystemTreeSource = fileSystemTreeSource; _visualStudioPackageProvider = visualStudioPackageProvider; _vsGlyphService = vsGlyphService; _imageSourceFactory = imageSourceFactory; _openDocumentHelper = openDocumentHelper; _fileSystem = fileSystem; _clipboard = clipboard; _windowsExplorer = windowsExplorer; _uiRequestProcessor = uiRequestProcessor; _eventBus = eventBus; _globalSettingsProvider = globalSettingsProvider; _delayedOperationProcessor = delayedOperationProcessor; _uiThread = uiThread; }
internal DiagnosticsManager(IDebugLogService logService, IEventBus eventBus, IConfigurationManager configurationManager, ILogger logger) { _logService = logService; _configurationManager = configurationManager; eventBus.Subscribe<ErrorEvent>(HandleErrorEvent); _logger = logger; }
public void SetUp() { channelMock = MockRepository.GenerateStub<IModel>(); eventBus = MockRepository.GenerateStub<IEventBus>(); publisher = new PublisherBasic(eventBus); }
public StorEvilGlossaryJob(IStepProvider stepProvider, IStepDescriber stepDescriber, IEventBus bus, IGlossaryFormatter formatter) { _stepProvider = stepProvider; _stepDescriber = stepDescriber; _bus = bus; _formatter = formatter; }
public SqlServerPersistenceManager(string connectionString, IContext context, IEventBus eventBus, IContainer container) { this.connectionString = connectionString; this.context = context; this.eventBus = eventBus; this.container = container; }
public void SetUp() { eventBus = new EventBus(); internalConsumers = new List<IInternalConsumer>(); createConsumerCalled = 0; mockBuilder = new MockBuilder(); queue = new Queue(queueName, false); onMessage = (body, properties, info) => Task.Factory.StartNew(() => { }); persistentConnection = MockRepository.GenerateStub<IPersistentConnection>(); internalConsumerFactory = MockRepository.GenerateStub<IInternalConsumerFactory>(); internalConsumerFactory.Stub(x => x.CreateConsumer()).WhenCalled(x => { var internalConsumer = MockRepository.GenerateStub<IInternalConsumer>(); internalConsumers.Add(internalConsumer); createConsumerCalled++; x.ReturnValue = internalConsumer; }).Repeat.Any(); consumer = new PersistentConsumer( queue, onMessage, persistentConnection, internalConsumerFactory, eventBus); AdditionalSetup(); }
public NinjectedCommandBus(IEventBus eventBus, IKernel kernel) : base(eventBus) { _kernel = kernel; RegisterHandler<EmployeeAggregate>(); }
public FacebookAccountRepository(IAccountRepository accountRepository, IFacebookDataRepository facebookDataRepository, IEventBus eventBus) { this.accountRepository = accountRepository; this.facebookDataRepository = facebookDataRepository; this.eventBus = eventBus; }
internal RegistrationManager( IRegistrationContext registrationContext, IModuleManager moduleManager, IPublicRegistrationService publicRegistrationService, ISdkInformation sdkInformation, IEnvironmentInformation environmentInformation, IServiceContext serviceContext, ISecureRegistrationService secureRegistrationService, IConfigurationManager configurationManager, IEventBus eventBus, IRefreshToken tokenRefresher, ILogger logger, IJsonSerialiser serialiser) { _registrationContext = registrationContext; _moduleManager = moduleManager; _publicRegistrationService = publicRegistrationService; _sdkInformation = sdkInformation; _environmentInformation = environmentInformation; _serviceContext = serviceContext; _secureRegistrationService = secureRegistrationService; _configurationManager = configurationManager; _eventBus = eventBus; _tokenRefresher = tokenRefresher; _logger = logger; _serialiser = serialiser; }
/// <summary> /// Configuration routine of the autofac container. /// </summary> /// <param name="eventBus">The event bus.</param> /// <param name="hoardeManager">The hoarde manager.</param> /// <param name="configurationManager">The host's configuration manager.</param> public static void Configure(IEventBus eventBus, ServiceModel.IHoardeManager hoardeManager, INutConfiguration configurationManager) { var builder = new ContainerBuilder(); builder.RegisterInstance(eventBus); builder.RegisterInstance(hoardeManager); builder.RegisterInstance(configurationManager); builder.RegisterType<ServiceModel.ServicesManager>().AsImplementedInterfaces().SingleInstance(); builder.RegisterType<ServiceModel.PollingClientCollection>().AsSelf().SingleInstance(); builder.RegisterType<ServiceModel.RegisteredPackagesPollingClient>().AsSelf().SingleInstance(); builder.RegisterType<ServiceModel.ReleasesPollingClient>(); builder.RegisterType<ConfigurationManagement.DbConfigurationSettings>(); // we will apply most of the configuration in one or more assembly modules. builder.RegisterAssemblyModules(typeof(AutofacConfig).Assembly); switch (configurationManager.Mode) { case ExecutionMode.Development: builder.RegisterType<Repositories.OnDisk.OnDiskPackageRepository>().AsImplementedInterfaces().InstancePerLifetimeScope(); break; case ExecutionMode.Production: builder.RegisterType<Repositories.SQLiteRepositories.PackageRepository>().AsImplementedInterfaces().InstancePerLifetimeScope(); break; default: builder.RegisterType<Repositories.SQLiteRepositories.PackageRepository>().AsImplementedInterfaces().InstancePerLifetimeScope(); _log.WarnFormat("Unknown execution mode '{mode}'. Registered Sqlite Repository.", configurationManager.Mode); break; } _container = builder.Build(); }
public ServicesManager( INutConfiguration configurationManager, Infrastructure.ConfigurationManagement.DbConfigurationSettings.Factory dbConfigurationSettingsFactory, IEventBus eventBus, IEnumerable<IReportPeriodically> pushServices, IEnumerable<IRemoteInvocationService> remoteInvokedServices, Services.IGlobalSettingsService globalSettings, Func<RegisteredPackagesPollingClient> packagesPollerFactory, Func<PollingClientCollection> pollingCollectionFactory, Repositories.IPackageRepository packageRepository, IHoardeManager hoardeManager) { _log = LogProvider.For<ServicesManager>(); _configurationManager = configurationManager; _dbConfigurationSettingsFactory = dbConfigurationSettingsFactory; _eventBus = eventBus; _pushServices = pushServices; _remoteInvokedServices = remoteInvokedServices; _globalSettings = globalSettings; _packagesPollerFactory = packagesPollerFactory; _pollingCollectionFactory = pollingCollectionFactory; _packageRepository = packageRepository; _hoardeManager = hoardeManager; }
public LoginController(IAuthenticator authenticator, IAccountRepository accountRepository, IEventBus eventBus, IFacebookDataRepository facebookDataRepository) { this.authenticator = authenticator; this.accountRepository = accountRepository; this.eventBus = eventBus; this.facebookDataRepository = facebookDataRepository; }
public InPlaceStoryRunner(ScenarioInterpreter scenarioInterpreter, IStoryFilter filter, ISessionContext context, IEventBus eventBus) : base(filter, context, eventBus) { _scenarioRunner = new InPlaceScenarioRunner(eventBus, scenarioInterpreter); }
public ScenarioLineExecuter(ScenarioInterpreter scenarioInterpreter, IEventBus eventBus) { _memberInvoker = new MemberInvoker(); _scenarioInterpreter = scenarioInterpreter; _eventBus = eventBus; }
public HistoricDataHandler(IEventBus eventBus, IMarketData marketData) { this.eventBus = eventBus; this.marketData = marketData; this.ContinueBacktest = true; this.timeEnumerator = this.marketData.RowKeys.GetEnumerator(); this.CurrentTime = null; }
private void SetupSubscriptions(IEventBus bus) { bus.Event<TrackingRecord>().Subscribe(record => { //var group = record.Level.ToString("G").ToLowerInvariant(); Clients.All.onTrackingRecord(record); }); }
public FileRegistrationRequestService( IUIRequestProcessor uiRequestProcessor, IFileSystem fileSystem, IEventBus eventBus) { _uiRequestProcessor = uiRequestProcessor; _fileSystem = fileSystem; _eventBus = eventBus; }
public virtual void TestFixtureSetUp() { _context = new XmlApplicationContext(ConfigFiles); _bus = _context.GetObject("IEventBus") as IEventBus; //Hack so that we don't have to validate the Anubis server certificate. ServicePointManager.ServerCertificateValidationCallback = delegate { return true; }; }
public Message(string title, string content, Contact sender, Contact receiver) { Title = title; Content = content; Sender = sender; Receiver = receiver; eventBus = IocContainer.Default.Resolve<IEventBus>(); }
public ApnsRemoteNotificationChannel(IEventBus eventBus) { _eventBus = eventBus; eventBus.Subscribe<ApnsRegistrationChangedEvent>(HandleApnsRegistrationChanged); eventBus.Subscribe<ApnsNotificationReceivedEvent>(HandleApnsNotificationReceived); eventBus.Subscribe<RefreshApnsConfigurationEvent>(HandleRefreshApnsConfiguration); }
public AbpExceptionFilter(IErrorInfoBuilder errorInfoBuilder, IAbpAspNetCoreConfiguration configuration) { _errorInfoBuilder = errorInfoBuilder; _configuration = configuration; Logger = NullLogger.Instance; EventBus = NullEventBus.Instance; }
public GcmRemoteNotificationChannel(IEventBus eventBus, IJsonSerialiser serialiser, IConfigurationManager configurationManager) { _eventBus = eventBus; _serialiser = serialiser; _configurationManager = configurationManager; eventBus.Subscribe<GcmNotificationReceivedEvent>(HandleGcmNotification); }
public RemoteStoryHandler(string assemblyLocation, IFilesystem filesystem,IEventBus eventBus, IEnumerable<string> assemblyLocations) { _assemblyLocation = assemblyLocation; _assemblyLocations = assemblyLocations; _filesystem = filesystem; _eventBus = eventBus; }
public HireCommandHandler(IEventBus bus) { _bus = bus; }
public RoleService(IUnitOfWork uow, IEventBus bus) : base(uow, bus) { }
public DomainEventConsumer(IEventBus eventBus) { this.eventBus = eventBus; }
public TransferAccountController(IEventBus @event) { this.@event = @event; }
public TransactionController(IServiceTransaction services, IEventBus bus, IServiceAccount servicesAccount) { _services = services; _bus = bus; _servicesAccount = servicesAccount; }
/// <summary> /// Initializes a new instance of the <see cref="CreateProcedureCommandHandler" /> class. /// </summary> /// <param name="procedureRepository">The procedure repository.</param> /// <param name="eventBus">The event bus.</param> public CreateProcedureCommandHandler(IProcedureRepository procedureRepository, IEventBus eventBus) { this._procedureRepository = procedureRepository; this._eventBus = eventBus; }
public EventBusSubscription(EventHandler <TEventType> eventReference, IEventBus bus, EventBusSubscriptionMode mode) : this(eventReference, new GenericSubscriptionToken <TEventType>(bus, mode)) { }
public EditApiKeyHandler(IAdoNetUnitOfWork unitOfWork, IEventBus eventBus) { _unitOfWork = unitOfWork; _eventBus = eventBus; }
public static async Task PublishAsync(this IEventBus bus, IAggregateRoot aggregateRoot) { await bus.TriggerAsync(aggregateRoot.Events); aggregateRoot.EmptyEvents(); }
/// <summary> /// Adds a bus to the list of buses. /// </summary> /// <param name="bus">A bus to be added.</param> public void AddBus(IEventBus bus) { _wrappedBuses.Add(bus); }
/// <summary> /// Removes a bus from the list of buses. /// </summary> /// <param name="bus">A bus to be removed.</param> public void RemoveBus(IEventBus bus) { _wrappedBuses.Remove(bus); }
public NotifyCommandHandler(IEventBus bus) { _bus = bus; }
public TransferService(ITransferRepositry transferRepository, IEventBus bus) { _transferRepository = transferRepository; _bus = bus; }
public MyEntityCommandHandler(IUnitOfWork unitOfWork, IEventBus eventBus) { _unitOfWork = unitOfWork; _eventBus = eventBus; }
public PickAndTakeToCustomer(IEventBus eventBus) { _eventBus = eventBus; }
public ValuesController(IEventBus eventBus) { _eventBus = eventBus; }
public AccountServices(IAccountRepository accountRepository, IEventBus bus) { _accountRepository = accountRepository; _bus = bus; }
public OrderConfirmedEventHandler(IEventBus bus) { _bus = bus; }
public PositionDataInterceptor(IServiceProvider provider, IDbContext dataAccessor, DbSession dbSession) : base(provider, dataAccessor, dbSession) { _logger = _loggerFactory.CreateLogger <PositionDataInterceptor>(); _eventBus = provider.GetService <IEventBus>(); }
public SqlDataContext(Func <DbContext> contextFactory, IEventBus eventBus) { this.eventBus = eventBus; this.context = contextFactory.Invoke(); }
/// <summary> /// Initializes a new instance of <c>EventSourcedDomainRepository</c> class. /// </summary> /// <param name="domainEventStorage">The <see cref="Apworks.Events.Storage.IDomainEventStorage"/> instance /// that handles the storage mechanism for domain events.</param> /// <param name="eventBus">The <see cref="Apworks.Bus.IEventBus"/> instance to which the domain events /// are published.</param> /// <param name="snapshotProvider">The <see cref="Apworks.Snapshots.Providers.ISnapshotProvider"/> instance /// that is used for handling the snapshot operations.</param> public EventSourcedDomainRepository(IDomainEventStorage domainEventStorage, IEventBus eventBus, ISnapshotProvider snapshotProvider) : base(eventBus) { this.domainEventStorage = domainEventStorage; this.snapshotProvider = snapshotProvider; }
public NoteController(IMediator mediator, IEventBus bus) : base(mediator) { _bus = bus; }
public static Task TriggerAsync(this IEventBus bus, IEnumerable <IDomainEvent> events) { var tasks = events.Select(async domainEvent => await bus.TriggerAsync(domainEvent)); return(Task.WhenAll(tasks)); }
public AccountService(IAccountRepository accountRepository, IEventBus eventBus) { _accountRepository = accountRepository; _eventBus = eventBus; }
public TestUnitWorkAppService(IUnitWork1Repository TestUnit1WorkRepository, IUnitWork2Repository TestUnit2WorkRepository, IMapper mapper, IEventBus eventBus) { _TestUnitWork1Repository = TestUnit1WorkRepository; _TestUnitWork2Repository = TestUnit2WorkRepository; _mapper = mapper; EventBus = eventBus; }
public GameFileService(AppData appData, CardLoadService cardLoadService, LoadingStatusService loadingStatusService, LoggingService loggingService, IEventBus eventBus) { _appData = appData; _cardLoadService = cardLoadService; _loadingStatusService = loadingStatusService; _logger = loggingService; _eventBus = eventBus; eventBus.SubscribeToCardGroupButtonsChanged(CardGroupButtonsChangedHandler); }
public EventSourcedAggregateTransactionnalRepository(IEventStore <TAggregateId> eventStore, IEventBus publisher, IEmptyAggregateFactory <TAggregate, TAggregateId, TEntityId> emptyAggregateFactory, IIdProvider <TAggregateId> idProvider) : base(eventStore, publisher, emptyAggregateFactory) => _idProvider = idProvider;
public QueueCommandHandler(IEventBus eventBus) { _eventBus = eventBus ?? throw new ArgumentNullException(nameof(eventBus)); }
protected virtual void RegisterConcurrentHandler(IEventBus eventBus) { eventBus.Register <TestEvent, TestEventHandler1>(); }
public DemoBackgroundService(IEventBus eventBus, ILogger <DemoBackgroundService> logger) { _eventBus = eventBus; _logger = logger; }