/// <summary> /// Initializes a new instance of the <see cref="FailoverInjectionInvoker" /> class. /// </summary> /// <param name="serviceCommandProvider">The service command provider.</param> /// <param name="serviceEntryManager">The service entry manager.</param> /// <param name="typeConvertibleService">The type convertible service.</param> public FailoverInjectionInvoker(IServiceCommandProvider serviceCommandProvider, IServiceEntryManager serviceEntryManager, ITypeConvertibleService typeConvertibleService) { _serviceCommandProvider = serviceCommandProvider; _serviceEntryManager = serviceEntryManager; _typeConvertibleService = typeConvertibleService; }
public ServiceEntryFactory(IServiceProvider serviceProvider, IServiceIdGenerator serviceIdGenerator, ITypeConvertibleService typeConvertibleService) { _serviceProvider = serviceProvider; _serviceIdGenerator = serviceIdGenerator; _typeConvertibleService = typeConvertibleService; }
public ClrServiceEntryFactory(CPlatformContainer serviceProvider, IServiceIdGenerator serviceIdGenerator, ITypeConvertibleService typeConvertibleService, IValidationProcessor validationProcessor) { _serviceProvider = serviceProvider; _serviceIdGenerator = serviceIdGenerator; _typeConvertibleService = typeConvertibleService; _validationProcessor = validationProcessor; }
public ClrServiceEntryFactory(IServiceProvider serviceProvider, IServiceIdGenerator serviceIdGenerator, ITypeConvertibleService typeConvertibleService, ILoggerFactory loggerFactory) { _serviceProvider = serviceProvider; _serviceIdGenerator = serviceIdGenerator; _typeConvertibleService = typeConvertibleService; _logger = loggerFactory.CreateLogger <ClrServiceEntryFactory>(); }
public ActionFilterAttribute(IEnumerable <IExceptionFilter> filters) { _serializer = ServiceLocator.Current.Resolve <ISerializer <string> >(); _serviceEntryLocate = ServiceLocator.Current.Resolve <IServiceEntryLocate>(); _typeConvertibleService = ServiceLocator.Current.Resolve <ITypeConvertibleService>(); _filters = filters; }
public ServiceProxyFactory(IRemoteInvokeService remoteInvokeService, ITypeConvertibleService typeConvertibleService, IServiceProvider serviceProvider) { _remoteInvokeService = remoteInvokeService; _typeConvertibleService = typeConvertibleService; _serviceProvider = serviceProvider; }
public UserServiceClientProxy( IRemoteInvokeService remoteInvokeService, ITypeConvertibleService typeConvertibleService, String serviceKey, CPlatformContainer serviceProvider) : base(remoteInvokeService, typeConvertibleService, serviceKey, serviceProvider) { }
public ServiceEntryFactory(IServiceProvider serviceProvider, IServiceIdGenerator serviceIdGenerator, ITypeConvertibleService typeConvertibleService, IAuthorizationServerProvider authorizationServerProvider) { _serviceProvider = serviceProvider; _serviceIdGenerator = serviceIdGenerator; _typeConvertibleService = typeConvertibleService; _authorization = authorizationServerProvider; }
public FailoverHandoverInvoker(IRemoteInvokeService remoteInvokeService, IServiceCommandProvider commandProvider, ITypeConvertibleService typeConvertibleService, IBreakeRemoteInvokeService breakeRemoteInvokeService) { _remoteInvokeService = remoteInvokeService; _typeConvertibleService = typeConvertibleService; _breakeRemoteInvokeService = breakeRemoteInvokeService; _commandProvider = commandProvider; }
protected ServiceProxyBase(IRemoteInvokeService remoteInvokeService, ITypeConvertibleService typeConvertibleService, String serviceKey, CPlatformContainer serviceProvider) { _remoteInvokeService = remoteInvokeService; _typeConvertibleService = typeConvertibleService; _serviceKey = serviceKey; _serviceProvider = serviceProvider; _commandProvider = serviceProvider.GetInstances <IServiceCommandProvider>(); _breakeRemoteInvokeService = serviceProvider.GetInstances <IBreakeRemoteInvokeService>(); }
public ServiceProxyFactory(IRemoteInvokeService remoteInvokeService, ITypeConvertibleService typeConvertibleService, IEnumerable <Type> serviceTypes, IEnumerable <Type> clientTypes) { _remoteInvokeService = remoteInvokeService; _typeConvertibleService = typeConvertibleService; _serviceTypes = serviceTypes; foreach (var type in clientTypes) { types.TryAdd(type, new ConcurrentDictionary <EndPoint, object>()); } }
public HttpExecutor(IServiceEntryLocate serviceEntryLocate, IServiceRouteProvider serviceRouteProvider, IAuthorizationFilter authorizationFilter, ITypeConvertibleService typeConvertibleService) { _serviceEntryLocate = serviceEntryLocate; _typeConvertibleService = typeConvertibleService; _serviceRouteProvider = serviceRouteProvider; _authorizationFilter = authorizationFilter; //_serviceProxyProvider = serviceProxyProvider; _diagnosticListener = new DiagnosticListener("BimTechDiagnosticListener"); }
public ServiceProxyFactory(IRemoteInvokeService remoteInvokeService, ITypeConvertibleService typeConvertibleService, IServiceProvider serviceProvider, IEnumerable <Type> types) { _remoteInvokeService = remoteInvokeService; _typeConvertibleService = typeConvertibleService; _serviceProvider = serviceProvider; if (types != null) { _serviceTypes = _serviceProvider.GetService <IServiceProxyGenerater>().GenerateProxys(types).ToArray(); } }
public ServiceProxyFactory(IRemoteInvokeService remoteInvokeService, ITypeConvertibleService typeConvertibleService, IServiceProvider serviceProvider, IEnumerable <Type> types, IEnumerable <string> namespaces) { _remoteInvokeService = remoteInvokeService; _typeConvertibleService = typeConvertibleService; _serviceProvider = serviceProvider; if (types != null) { RegisterProxType(namespaces.ToArray(), types.ToArray()); } }
public HttpServiceExecutor(IServiceEntryLocate serviceEntryLocate, IServiceRouteProvider serviceRouteProvider, IAuthorizationFilter authorizationFilter, ILogger <HttpServiceExecutor> logger, CPlatformContainer serviceProvider, ITypeConvertibleService typeConvertibleService) { _serviceEntryLocate = serviceEntryLocate; _logger = logger; _serviceProvider = serviceProvider; _typeConvertibleService = typeConvertibleService; _serviceRouteProvider = serviceRouteProvider; _authorizationFilter = authorizationFilter; }
public HttpExecutor(IServiceEntryLocate serviceEntryLocate, IServiceRouteProvider serviceRouteProvider, IAuthorizationFilter authorizationFilter, ILogger <HttpExecutor> logger, CPlatformContainer serviceProvider, IServiceProxyProvider serviceProxyProvider, ITypeConvertibleService typeConvertibleService) { _serviceEntryLocate = serviceEntryLocate; _logger = logger; _serviceProvider = serviceProvider; _typeConvertibleService = typeConvertibleService; _serviceRouteProvider = serviceRouteProvider; _authorizationFilter = authorizationFilter; _serviceProxyProvider = serviceProxyProvider; _diagnosticListener = new DiagnosticListener(DiagnosticListenerExtensions.DiagnosticListenerName); }
protected ServiceProxyBase(IRemoteInvokeService remoteInvokeService, ITypeConvertibleService typeConvertibleService, String serviceKey, CPlatformContainer serviceProvider) { _remoteInvokeService = remoteInvokeService; _typeConvertibleService = typeConvertibleService; _serviceKey = serviceKey; _serviceProvider = serviceProvider; _commandProvider = serviceProvider.GetInstances <IServiceCommandProvider>(); _breakeRemoteInvokeService = serviceProvider.GetInstances <IBreakeRemoteInvokeService>(); if (serviceProvider.Current.IsRegistered <IInterceptor>()) { _interceptor = serviceProvider.GetInstances <IInterceptor>(); } }
private void SetSampleParameterValue(ITypeConvertibleService typeConvertibleService, object parameter, ParameterDescriptor parameterDescriptor, List <object> list) { var dict = (IDictionary <string, object>)typeConvertibleService.Convert(parameter, typeof(IDictionary <string, object>)); var parameterVal = parameterDescriptor.ParameterInfo.GetDefaultValue(); if (dict.ContainsKey(parameterDescriptor.Name)) { parameterVal = dict[parameterDescriptor.Name]; } list.Add(parameterVal); }
protected ServiceProxyBase(IRemoteInvokeService remoteInvokeService, ITypeConvertibleService typeConvertibleService, String serviceKey, CPlatformContainer serviceProvider) { _remoteInvokeService = remoteInvokeService; _typeConvertibleService = typeConvertibleService; _serviceKey = serviceKey; _serviceProvider = serviceProvider; _commandProvider = serviceProvider.GetInstances <IServiceCommandProvider>(); _breakeRemoteInvokeService = serviceProvider.GetInstances <IBreakeRemoteInvokeService>(); if (serviceProvider.Current.IsRegistered <IInterceptor>()) { var interceptors = serviceProvider.GetInstances <IEnumerable <IInterceptor> >(); _interceptors = interceptors.Where(p => !typeof(CacheInterceptor).IsAssignableFrom(p.GetType())); _cacheInterceptor = interceptors.Where(p => typeof(CacheInterceptor).IsAssignableFrom(p.GetType())).FirstOrDefault(); } }
private static string GetHashKey(object[] parameterValues, ParameterDescriptor parameterDescriptor, int index, ITypeConvertibleService typeConvertibleService) { string hashKey; if (parameterDescriptor.IsSample) { var propVal = parameterValues[index]; if (propVal == null) { throw new LmsException("hashKey指定的值不允许为空"); } hashKey = propVal.ToString(); } else { var parameterValue = typeConvertibleService.Convert(parameterValues[index], parameterDescriptor.Type); var hashKeyProp = parameterDescriptor.Type .GetProperties().First(); var hashKeyProviderProps = parameterDescriptor.Type .GetProperties() .Where(p => p.GetCustomAttributes().OfType <IHashKeyProvider>().Any()); if (hashKeyProviderProps.Any()) { hashKeyProp = hashKeyProviderProps.First(); } var propValue = hashKeyProp.GetValue(parameterValue); if (propValue == null) { throw new LmsException("hashKey指定的属性的值不允许为空"); } hashKey = propValue.ToString(); } return(hashKey); }
private static List <dynamic> ProxyAll() { var serviceProvider = Builder(); var serviceProxyGenerate = serviceProvider.GetRequiredService <IServiceProxyGenerater>(); var serviceProxyFactory = serviceProvider.GetRequiredService <IServiceProxyFactory>(); var path = AppDomain.CurrentDomain.BaseDirectory; var files = new DirectoryInfo(path).GetFiles(); var types = (from file in files where file.Name.Contains("interfaces") && file.Extension.Contains("dll") from type in Assembly.LoadFrom(file.ToString()).GetExportedTypes() where type.IsInterface select type).ToList(); var objs = serviceProxyGenerate.GenerateProxys(types) .Select(proxy => serviceProxyFactory.CreateProxy(proxy)) .Cast <dynamic>().ToList(); IRemoteInvokeService = serviceProvider.GetRequiredService <IRemoteInvokeService>(); ITypeConvertibleService = serviceProvider.GetRequiredService <ITypeConvertibleService>(); return(objs); }
public DefaultValidationProcessor(ITypeConvertibleService typeConvertibleService) { _typeConvertibleService = typeConvertibleService; }
public ServiceProxyFactory(IRemoteInvokeService remoteInvokeService, ITypeConvertibleService typeConvertibleService) { _remoteInvokeService = remoteInvokeService; _typeConvertibleService = typeConvertibleService; }
public ClrServiceEntryFactory(IServiceInstanceFactory serviceFactory, IServiceIdGenerator serviceIdGenerator, ITypeConvertibleService typeConvertibleService) { _serviceFactory = serviceFactory; _serviceIdGenerator = serviceIdGenerator; _typeConvertibleService = typeConvertibleService; }
/// <summary> /// Initializes a new instance of the <see cref="RemoteServiceProxy" /> class. /// </summary> /// <param name="remoteInvokeService">The remote invoke service.</param> /// <param name="typeConvertibleService">The type convertible service.</param> /// <param name="serviceKey">The service key.</param> /// <param name="serviceProvider">The service provider.</param> /// <param name="serviceRouteProvider">The service route provider.</param> public RemoteServiceProxy(IRemoteInvokeService remoteInvokeService, ITypeConvertibleService typeConvertibleService, string serviceKey, CPlatformContainer serviceProvider, IServiceRouteProvider serviceRouteProvider ) : base(remoteInvokeService, typeConvertibleService, serviceKey, serviceProvider, serviceRouteProvider) { }
public ServiceProxyFactory(IRemoteServiceInvoker remoteServiceInvoker, ITypeConvertibleService typeConvertibleService) { _remoteServiceInvoker = remoteServiceInvoker; _typeConvertibleService = typeConvertibleService; }
protected ServiceProxyBase(IRemoteInvokeService remoteInvokeService, ITypeConvertibleService typeConvertibleService, EndPoint endPoint) { _remoteInvokeService = remoteInvokeService; _typeConvertibleService = typeConvertibleService; _endPoint = endPoint; }
public ClrServiceEntryFactory(CPlatformContainer serviceProvider, IServiceIdGenerator serviceIdGenerator, ITypeConvertibleService typeConvertibleService) { _serviceProvider = serviceProvider; _serviceIdGenerator = serviceIdGenerator; _typeConvertibleService = typeConvertibleService; }
protected ServiceProxyBase(IRemoteInvokeService remoteInvokeService, ITypeConvertibleService typeConvertibleService) { _remoteInvokeService = remoteInvokeService; _typeConvertibleService = typeConvertibleService; }
public ServiceProxyFactory(IRemoteInvokeService remoteInvokeService, ITypeConvertibleService typeConvertibleService, IServiceProvider serviceProvider, IServiceRouteProvider serviceRouteProvider) : this(remoteInvokeService, typeConvertibleService, serviceProvider, serviceRouteProvider, null, null) { }