Facility to simplify the management of WCF clients and services.
Inheritance: Castle.MicroKernel.Facilities.AbstractFacility
示例#1
0
        internal void Init(IKernel kernel, WcfFacility facility)
        {
            this.kernel   = kernel;
            this.facility = facility;

            AddDefaultChannelBuilders();
            AddDefaultBindingPolicies();

            kernel.Register(
                Component.For(typeof(IChannelFactoryBuilder <>))
                .ImplementedBy(typeof(AsynChannelFactoryBuilder <>))
                .DependsOn(Property.ForKey <ProxyGenerator>().Eq(proxyGenerator))
                .Unless(Component.ServiceAlreadyRegistered)
                );

            if (kernel.GetFacilities().OfType <TypedFactoryFacility>().Any())
            {
                kernel.Register(
                    Component.For <IWcfClientFactory>().AsFactory(c => c.SelectedWith(new WcfClientFactorySelector()))
                    );
            }

            kernel.ComponentModelCreated += Kernel_ComponentModelCreated;
            kernel.ComponentUnregistered += Kernel_ComponentUnregistered;

            if (afterInit != null)
            {
                afterInit();
                afterInit = null;
            }
        }
示例#2
0
        internal void Init(IKernel kernel, WcfFacility facility)
        {
            this.kernel   = kernel;
            this.facility = facility;
            GlobalKernel  = kernel;

            ConfigureAspNetCompatibility();
            AddDefaultServiceHostBuilders();

            kernel.ComponentModelCreated += Kernel_ComponentModelCreated;
            kernel.ComponentRegistered   += Kernel_ComponentRegistered;

            if (afterInit != null)
            {
                afterInit();
                afterInit = null;
            }
        }
示例#3
0
        internal void Init(IKernel kernel, WcfFacility facility)
        {
            this.kernel   = kernel;
            this.facility = facility;

            ConfigureAspNetCompatibility();
            AddDefaultServiceHostBuilders();
            DefaultServiceHostFactory.RegisterContainer(kernel);

            kernel.ComponentModelCreated += Kernel_ComponentModelCreated;
            kernel.ComponentRegistered   += Kernel_ComponentRegistered;
            kernel.ComponentUnregistered += Kernel_ComponentUnregistered;

            if (_afterInit != null)
            {
                _afterInit();
                _afterInit = null;
            }
        }