예제 #1
0
 public UserTaskEndpoint(TaskDistributor taskDistributor, ConnectionLookup connectionLookup, IBus messageBus)
 {
     this.taskDistributor  = taskDistributor;
     this.connectionLookup = connectionLookup;
     this.messageBus       = messageBus;
 }
 public UserTaskEndpoint(TaskDistributor taskDistributor, ConnectionLookup connectionLookup, IBus messageBus)
 {
     this.taskDistributor = taskDistributor;
     this.connectionLookup = connectionLookup;
     this.messageBus = messageBus;
 }
예제 #3
0
        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));
        }
예제 #4
0
 public TaskNotifier(ConnectionLookup connectionLookup)
 {
     this.connectionLookup = connectionLookup;
 }
예제 #5
0
 public TaskNotifier(ConnectionLookup connectionLookup)
 {
     this.connectionLookup = connectionLookup;
 }