Exemplo n.º 1
0
        public WcfChannelWrapper <T> CreateWcfChannel <T>()
            where T : class
        {
            ChannelFactory cf;

            if (!_cfCache.TryGetValue(typeof(T), out cf))
            {
                lock (_cfCacheLock)
                {
                    if (!_cfCache.TryGetValue(typeof(T), out cf))
                    {
                        if (typeof(T) == typeof(IWcfConfigurationService))
                        {
                            cf = new ChannelFactory <IWcfConfigurationService>(WCFCONFIGURATIONSERVICE_ENDPOINT_NAME);
                        }
                        else
                        {
                            var endpoint = WcfConfigurationServiceProxy.GetWcfClientEndpoint(typeof(T));
                            cf = WcfChannelFactoryFactory.CreateChannelFactory <T>(endpoint);
                        }
                        _cfCache[typeof(T)] = cf;
                    }
                }
            }

            return(new WcfChannelWrapper <T>((cf as ChannelFactory <T>).CreateChannel()));
        }
Exemplo n.º 2
0
 public override NIntegrate.ServiceModel.Configuration.WcfService LoadServiceConfiguration(Type serviceType)
 {
     return(WcfConfigurationServiceProxy.GetWcfService(serviceType, GetLoadBalancePath(_baseAddresses)));
 }