public ServiceProxyResponder(BamConf conf, ILogger logger) : base(conf, logger) { _commonServiceProvider = new Incubator(); _appServiceProviders = new Dictionary <string, Incubator>(); _appSecureChannels = new Dictionary <string, SecureChannel>(); _commonSecureChannel = new SecureChannel(); RendererFactory = new RendererFactory(logger); AddCommonService(_commonSecureChannel); CommonServiceAdded += (type, obj) => { CommonSecureChannel.ServiceProvider.Set(type, obj); }; CommonServiceRemoved += (type) => { CommonSecureChannel.ServiceProvider.Remove(type); }; AppServiceAdded += (appName, type, instance) => { if (!AppSecureChannels.ContainsKey(appName)) { SecureChannel channel = new SecureChannel(); channel.ServiceProvider.CopyFrom(CommonServiceProvider, true); AppSecureChannels.Add(appName, channel); } AppSecureChannels[appName].ServiceProvider.Set(type, instance, false); }; }
public ServiceProxyResponder(BamConf conf, ILogger logger) : base(conf, logger) { _commonServiceProvider = new Incubator(); _appServiceProviders = new Dictionary <string, Incubator>(); _appSecureChannels = new Dictionary <string, SecureChannel>(); _commonSecureChannel = new SecureChannel(); _clientProxyGenerators = new Dictionary <string, IClientProxyGenerator>(); RendererFactory = new RendererFactory(logger); ExecutionRequestResolver = new ExecutionRequestResolver(); AddCommonService(_commonSecureChannel); AddClientProxyGenerator(new CsClientProxyGenerator(), "proxies.cs", "csproxies", "csharpproxies"); AddClientProxyGenerator(new JsClientProxyGenerator(), "proxies.js", "jsproxies", "javascriptproxies"); CommonServiceAdded += (type, obj) => { CommonSecureChannel.ServiceProvider.Set(type, obj); }; CommonServiceRemoved += (type) => { CommonSecureChannel.ServiceProvider.Remove(type); }; AppServiceAdded += (appName, type, instance) => { if (!AppSecureChannels.ContainsKey(appName)) { SecureChannel channel = new SecureChannel(); channel.ServiceProvider.CopyFrom(CommonServiceProvider, true); AppSecureChannels.Add(appName, channel); } AppSecureChannels[appName].ServiceProvider.Set(type, instance, false); }; }