Ejemplo n.º 1
0
        public void MethodInterfaceShouldCreateActivity()
        {
            Assert.AreEqual(Guid.Empty, EventActivityScope.CurrentActivityId);

            // this proxy does create a new activity scope
            var tester = new AutomaticActivity();
            var proxy  = TracingProxy.CreateWithActivityScope <AutomaticActivity>(tester);

            proxy.Method();

            Assert.AreNotEqual(Guid.Empty, tester.ActivityId);

            Assert.AreEqual(Guid.Empty, EventActivityScope.CurrentActivityId);
        }
Ejemplo n.º 2
0
        public override void Load()
        {
            Bind <Configuration.Provider>().ToSelf(); // "Bebbs-Harmonize-With-LightwaveRf-Configuration-Provider"
            Bind <Configuration.IProvider>().ToMethod(ctx => TracingProxy.CreateWithActivityScope <Configuration.IProvider>(ctx.Kernel.Get <Configuration.Provider>())).InSingletonScope();

            Bind <Dimmer.Builder>().ToSelf(); // "Bebbs-Harmonize-With-LightwaveRf-Dimmer-Builder"
            Bind <Entity.IBuilder, Dimmer.IBuilder>().ToMethod(ctx => TracingProxy.CreateWithActivityScope <Dimmer.IBuilder>(ctx.Kernel.Get <Dimmer.Builder>())).InSingletonScope();

            Bind <Entity.Factory>().ToSelf(); // "Bebbs-Harmonize-With-LightwaveRf-Entity-Factory"
            Bind <Entity.IFactory>().ToMethod(ctx => TracingProxy.CreateWithActivityScope <Entity.IFactory>(ctx.Kernel.Get <Entity.Factory>())).InSingletonScope();

            Bind <WifiLink.CommandBuilder>().ToSelf();  // "Bebbs-Harmonize-With-LightwaveRf-WifiLink-CommandBuilder"
            Bind <WifiLink.ICommandBuilder>().ToMethod(ctx => TracingProxy.CreateWithActivityScope <WifiLink.ICommandBuilder>(ctx.Kernel.Get <WifiLink.CommandBuilder>())).InSingletonScope();
            Bind <WifiLink.CommandEndpoint>().ToSelf(); // "Bebbs-Harmonize-With-LightwaveRf-WifiLink-CommandEndpoint"
            Bind <WifiLink.ICommandEndpoint>().ToMethod(ctx => TracingProxy.CreateWithActivityScope <WifiLink.ICommandEndpoint>(ctx.Kernel.Get <WifiLink.CommandEndpoint>()));
            Bind <WifiLink.QueryEndpoint>().ToSelf();   // "Bebbs-Harmonize-With-LightwaveRf-WifiLink-QueryEndpoint"
            Bind <WifiLink.IQueryEndpoint>().ToMethod(ctx => TracingProxy.CreateWithActivityScope <WifiLink.IQueryEndpoint>(ctx.Kernel.Get <WifiLink.QueryEndpoint>()));
            Bind <WifiLink.Bridge>().ToSelf();          // "Bebbs-Harmonize-With-LightwaveRf-WifiLink-Bridge"
            Bind <WifiLink.IBridge>().ToMethod(ctx => TracingProxy.CreateWithActivityScope <WifiLink.IBridge>(ctx.Kernel.Get <WifiLink.Bridge>())).InSingletonScope();

            Bind <Service>().ToSelf(); // "Bebbs-Harmonize-With-LightwaveRf-Service"
            Bind <IService>().ToMethod(ctx => TracingProxy.CreateWithActivityScope <IService>(ctx.Kernel.Get <Service>()));
        }
Ejemplo n.º 3
0
        public override void Load()
        {
            Bind <Harmonizer>().ToSelf();

            Bind <IHarmonizer>().ToMethod(ctx => TracingProxy.CreateWithActivityScope <IHarmonizer>(ctx.Kernel.Get <Harmonizer>()));
        }
Ejemplo n.º 4
0
 public override void Load()
 {
     Bind <Bootstrapper>().ToSelf();
     Bind <IBootstrapper>().ToMethod(ctx => TracingProxy.CreateWithActivityScope <IBootstrapper>(ctx.Kernel.Get <Bootstrapper>()));
 }