public UserTaskEndpoint(TaskDistributor taskDistributor, ConnectionLookup connectionLookup, IBus messageBus) { this.taskDistributor = taskDistributor; this.connectionLookup = connectionLookup; this.messageBus = messageBus; }
private void ConfigureIoC() { Container = new WindsorContainer(); var documentStore = new EmbeddableDocumentStore { DataDirectory = "../data" }; documentStore.Initialize(); var connectionLookup = new ConnectionLookup(); var taskNotifier = new TaskNotifier(connectionLookup); var queueFactory = new DefaultQueueFactory(taskNotifier, documentStore); var userAccountService = new DummyUserAccountService(); var taskDistributor = new TaskDistributor(queueFactory, userAccountService); sessionTimeoutEventSink = taskDistributor; Container.Register(Component.For<IDocumentStore>().Instance(documentStore).LifestyleSingleton()); Container.Register(Component.For<INotifyUsersOfTasks>().Instance(taskNotifier).LifestyleSingleton()); Container.Register(Component.For<TaskDistributor, IReactToUserLoggedIn, IReactToUserLoggedOff>().Instance(taskDistributor).LifestyleSingleton()); Container.Register(Component.For<IControllerFactory>() .Instance(new MyControllerFactory(Container)) .LifeStyle.Is(Castle.Core.LifestyleType.Singleton)); Container.Register(AllTypes.FromThisAssembly().BasedOn<IController>().LifestyleTransient()); GlobalHost.DependencyResolver.Register(typeof(TaskDistributor), () => taskDistributor); GlobalHost.DependencyResolver.Register(typeof(ConnectionLookup), () => connectionLookup); GlobalHost.DependencyResolver.Register(typeof(IBus), () => Bus); GlobalHost.DependencyResolver.Register(typeof(UserTaskEndpoint), () => new UserTaskEndpoint(taskDistributor, connectionLookup, Bus)); }
public TaskNotifier(ConnectionLookup connectionLookup) { this.connectionLookup = connectionLookup; }