Exemplo n.º 1
0
 public void Activate(IActivationLog log, IPerfTimer timer)
 {
     _graph.ReadSettings(_services);
     OpenChannels();
     _graph.StartReceiving(_pipeline, _logger);
     ExecuteActivators();
 }
 public void Activate(IEnumerable <IPackageInfo> packages, IPackageLog log)
 {
     _graph.ReadSettings(_services);
     OpenChannels();
     _graph.StartReceiving(_pipeline);
     ExecuteActivators();
 }
        public void reading_settings()
        {
            var channel = new ChannelSettings
            {
                Outbound   = new Uri("channel://outbound"),
                Downstream = new Uri("channel://downstream")
            };

            var bus = new BusSettings
            {
                Outbound   = new Uri("bus://outbound"),
                Downstream = new Uri("bus://downstream")
            };

            var services = new InMemoryServiceLocator();

            services.Add(channel);
            services.Add(bus);

            var graph = new ChannelGraph();

            graph.ChannelFor <ChannelSettings>(x => x.Outbound);
            graph.ChannelFor <ChannelSettings>(x => x.Downstream);
            graph.ChannelFor <BusSettings>(x => x.Outbound);
            graph.ChannelFor <BusSettings>(x => x.Downstream);

            graph.ReadSettings(services);

            graph.ChannelFor <ChannelSettings>(x => x.Outbound)
            .Uri.ShouldEqual(channel.Outbound);
            graph.ChannelFor <ChannelSettings>(x => x.Downstream)
            .Uri.ShouldEqual(channel.Downstream);
            graph.ChannelFor <BusSettings>(x => x.Outbound)
            .Uri.ShouldEqual(bus.Outbound);
            graph.ChannelFor <BusSettings>(x => x.Downstream)
            .Uri.ShouldEqual(bus.Downstream);
        }
Exemplo n.º 4
0
        public void reading_settings()
        {
            var channel = new ChannelSettings
            {
                Outbound = new Uri("channel://outbound"),
                Downstream = new Uri("channel://downstream")
            };

            var bus = new BusSettings
            {
                Outbound = new Uri("bus://outbound"),
                Downstream = new Uri("bus://downstream")
            };

            var services = new InMemoryServiceLocator();
            services.Add(channel);
            services.Add(bus);

            var graph = new ChannelGraph();
            graph.ChannelFor<ChannelSettings>(x => x.Outbound);
            graph.ChannelFor<ChannelSettings>(x => x.Downstream);
            graph.ChannelFor<BusSettings>(x => x.Outbound);
            graph.ChannelFor<BusSettings>(x => x.Downstream);

            graph.ReadSettings(services);

            graph.ChannelFor<ChannelSettings>(x => x.Outbound)
                 .Uri.ShouldBe(channel.Outbound);
            graph.ChannelFor<ChannelSettings>(x => x.Downstream)
                 .Uri.ShouldBe(channel.Downstream);
            graph.ChannelFor<BusSettings>(x => x.Outbound)
                .Uri.ShouldBe(bus.Outbound);
            graph.ChannelFor<BusSettings>(x => x.Downstream)
                .Uri.ShouldBe(bus.Downstream);
        }