Install() public method

public Install ( ICollection extensions, IWcfBurden burden ) : ServiceHostExtensions
extensions ICollection
burden IWcfBurden
return ServiceHostExtensions
		protected void ConfigureServiceHost(ServiceHost serviceHost, IWcfServiceModel serviceModel, ComponentModel model)
		{
			serviceHost.Description.Behaviors.Add(
				new WindsorDependencyInjectionServiceBehavior(kernel, model)
				);

			var burden = new WcfBurden(kernel);
			var contracts = new HashSet<ContractDescription>();
			Dictionary<IWcfEndpoint, ServiceEndpoint> endpoints = null;

			if (serviceModel != null && serviceModel.Endpoints.Count > 0)
			{
				endpoints = new Dictionary<IWcfEndpoint, ServiceEndpoint>();
				var builder = new ServiceEndpointBuilder(this, serviceHost);

				foreach (var endpoint in serviceModel.Endpoints)
				{
					endpoints.Add(endpoint, builder.AddServiceEndpoint(endpoint));
				}
			}

			var extensions = new ServiceHostExtensions(serviceHost, kernel)
				.Install(burden, new WcfServiceExtensions());

			if (serviceModel != null)
			{
				extensions.Install(serviceModel.Extensions, burden);
			}

			extensions.Install(burden, new WcfEndpointExtensions(WcfExtensionScope.Services));

			if (endpoints != null)
			{
				foreach (var endpoint in endpoints)
				{
					var addContract = contracts.Add(endpoint.Value.Contract);
					new ServiceEndpointExtensions(endpoint.Value, addContract, kernel)
						.Install(endpoint.Key.Extensions, burden);
				}
			}

			if (serviceHost is IWcfServiceHost)
			{
				var wcfServiceHost = (IWcfServiceHost)serviceHost;

				wcfServiceHost.EndpointCreated += (_, e) =>
				{
					var addContract = contracts.Add(e.Endpoint.Contract);
					var endpointExtensions = new ServiceEndpointExtensions(e.Endpoint, addContract, kernel)
						.Install(burden, new WcfEndpointExtensions(WcfExtensionScope.Services));

					if (serviceModel != null)
					{
						endpointExtensions.Install(serviceModel.Extensions, burden);
					}
				};
			}

			serviceHost.Extensions.Add(new WcfBurdenExtension<ServiceHostBase>(burden));
		}
        protected void ConfigureServiceHost(ServiceHost serviceHost, IWcfServiceModel serviceModel, ComponentModel model)
        {
            serviceHost.Description.Behaviors.Add(
                new WindsorDependencyInjectionServiceBehavior(kernel, model)
                );

            var burden    = new WcfBurden(kernel);
            var contracts = new HashSet <ContractDescription>();
            Dictionary <IWcfEndpoint, ServiceEndpoint> endpoints = null;

            if (serviceModel != null && serviceModel.Endpoints.Count > 0)
            {
                endpoints = new Dictionary <IWcfEndpoint, ServiceEndpoint>();
                var builder = new ServiceEndpointBuilder(this, serviceHost);

                foreach (var endpoint in serviceModel.Endpoints)
                {
                    endpoints.Add(endpoint, builder.AddServiceEndpoint(endpoint));
                }
            }

            var extensions = new ServiceHostExtensions(serviceHost, kernel)
                             .Install(burden, new WcfServiceExtensions());

            if (serviceModel != null)
            {
                extensions.Install(serviceModel.Extensions, burden);
            }

            extensions.Install(burden, new WcfEndpointExtensions(WcfExtensionScope.Services));

            if (endpoints != null)
            {
                foreach (var endpoint in endpoints)
                {
                    var addContract = contracts.Add(endpoint.Value.Contract);
                    new ServiceEndpointExtensions(endpoint.Value, addContract, kernel)
                    .Install(endpoint.Key.Extensions, burden);
                }
            }

            if (serviceHost is IWcfServiceHost)
            {
                var wcfServiceHost = (IWcfServiceHost)serviceHost;

                wcfServiceHost.EndpointCreated += (_, e) =>
                {
                    var addContract        = contracts.Add(e.Endpoint.Contract);
                    var endpointExtensions = new ServiceEndpointExtensions(e.Endpoint, addContract, kernel)
                                             .Install(burden, new WcfEndpointExtensions(WcfExtensionScope.Services));

                    if (serviceModel != null)
                    {
                        endpointExtensions.Install(serviceModel.Extensions, burden);
                    }
                };
            }

            serviceHost.Extensions.Add(new WcfBurdenExtension <ServiceHostBase>(burden));
        }