コード例 #1
0
ファイル: Bootstrapper.cs プロジェクト: canuzun/heartbeat
        public void Init()
        {
            var maxConcurrentCalls = int.Parse(ConfigurationManager.AppSettings["MaxConcurrentCalls"]);
            var maxConcurrentInstances = int.Parse(ConfigurationManager.AppSettings["MaxConcurrentInstances"]);
            var serviceBaseUrl = ConfigurationManager.AppSettings["ServiceBaseUrl"];

            _xServicebootstrapperHelper =
                new ExfBootstrapperHelper<IHeartbeatServer>(maxConcurrentCalls, maxConcurrentInstances, serviceBaseUrl);

            _xServicebootstrapperHelper.RegisterBasicHttpBinding<HeartbeatServer>();

            _xServicebootstrapperHelper.GetWindsorContainer()
                .Register(Component.For<HbArchiveProcessor>().LifeStyle.Singleton)
                .Register(Component.For<AppStatsProcessor>().LifeStyle.Singleton)
                .Register(Component.For<UdpServer>().LifeStyle.Singleton);

            //bunu silerseniz init olmaz, paketleri dinlemez.
            _xServicebootstrapperHelper.GetWindsorContainer().Resolve<UdpServer>();
        }
コード例 #2
0
ファイル: Bootstrapper.cs プロジェクト: canuzun/heartbeat
        public void Init()
        {
            int maxConcurrentCalls = int.Parse(ConfigurationManager.AppSettings["MaxConcurrentCalls"]);
            int maxConcurrentInstances = int.Parse(ConfigurationManager.AppSettings["MaxConcurrentInstances"]);
            string serviceBaseUrl = ConfigurationManager.AppSettings["ServiceBaseUrl"];

            _xServicebootstrapperHelper =
                new ExfBootstrapperHelper<IXService>(maxConcurrentCalls, maxConcurrentInstances, serviceBaseUrl);

            _xServicebootstrapperHelper.GetWindsorContainer()
                .Register(Component.For<ClientProcessor>().LifeStyle.Singleton)
                .Register(Component.For<HbInterceptor>().LifeStyle.PerWcfOperation());

            _xServicebootstrapperHelper.RegisterBasicHttpBinding<XService>(new[]
            {
                InterceptorReference.ForType<HbInterceptor>()
            });

            ContainerValidator.ValidateContainer(_xServicebootstrapperHelper.GetWindsorContainer());
        }
コード例 #3
0
        public void Init()
        {
            var maxConcurrentCalls     = int.Parse(ConfigurationManager.AppSettings["MaxConcurrentCalls"]);
            var maxConcurrentInstances = int.Parse(ConfigurationManager.AppSettings["MaxConcurrentInstances"]);
            var serviceBaseUrl         = ConfigurationManager.AppSettings["ServiceBaseUrl"];


            _xServicebootstrapperHelper =
                new ExfBootstrapperHelper <IHeartbeatServer>(maxConcurrentCalls, maxConcurrentInstances, serviceBaseUrl);

            _xServicebootstrapperHelper.RegisterBasicHttpBinding <HeartbeatServer>();

            _xServicebootstrapperHelper.GetWindsorContainer()
            .Register(Component.For <HbArchiveProcessor>().LifeStyle.Singleton)
            .Register(Component.For <AppStatsProcessor>().LifeStyle.Singleton)
            .Register(Component.For <UdpServer>().LifeStyle.Singleton);

            //bunu silerseniz init olmaz, paketleri dinlemez.
            _xServicebootstrapperHelper.GetWindsorContainer().Resolve <UdpServer>();
        }
コード例 #4
0
        public void Init()
        {
            int    maxConcurrentCalls     = int.Parse(ConfigurationManager.AppSettings["MaxConcurrentCalls"]);
            int    maxConcurrentInstances = int.Parse(ConfigurationManager.AppSettings["MaxConcurrentInstances"]);
            string serviceBaseUrl         = ConfigurationManager.AppSettings["ServiceBaseUrl"];


            _xServicebootstrapperHelper =
                new ExfBootstrapperHelper <IXService>(maxConcurrentCalls, maxConcurrentInstances, serviceBaseUrl);

            _xServicebootstrapperHelper.GetWindsorContainer()
            .Register(Component.For <ClientProcessor>().LifeStyle.Singleton)
            .Register(Component.For <HbInterceptor>().LifeStyle.PerWcfOperation());

            _xServicebootstrapperHelper.RegisterBasicHttpBinding <XService>(new[]
            {
                InterceptorReference.ForType <HbInterceptor>()
            });

            ContainerValidator.ValidateContainer(_xServicebootstrapperHelper.GetWindsorContainer());
        }