public CfHandler(IServiceActivator activator, IServiceInvoker invoker, ILogger logger, IQueue queue) { _activator = activator; _invoker = invoker; _logger = logger; _queue = queue; }
internal DataCenterService(Authentication authentication, IServiceInvoker serviceInvoker, GroupService groupService, AccountService accountService, BillingService billingService) : base(authentication, serviceInvoker) { this.groupService = groupService; this.accountService = accountService; this.billingService = billingService; }
public ScopeContext(string contextPath, IClientRegistry clientRegistry, IScopeResolver scopeResolver, IServiceInvoker serviceInvoker, IPersistenceStore persistanceStore) { _contextPath = contextPath; _clientRegistry = clientRegistry; _scopeResolver = scopeResolver; _persistanceStore = persistanceStore; _serviceInvoker = serviceInvoker; }
public RequestProcessor(JsonSerializer serializer, IServiceFactory serviceFactory, IServiceCatalog services, IServiceInvoker serviceInvoker) { this.serializer = serializer; this.serviceFactory = serviceFactory; this.services = services; this.serviceInvoker = serviceInvoker; }
public LinkSendService(IStorageRepository storageRepository, IPathFinder pathFinder, IServiceInvoker serviceInvoker, IRouteFinder routeFinder) { if (storageRepository == null) { throw new ArgumentNullException(nameof(storageRepository)); } this._storageRepository = storageRepository; if (serviceInvoker == null) { throw new ArgumentNullException(nameof(serviceInvoker)); } this._serviceInvoker = serviceInvoker; if (pathFinder == null) { throw new ArgumentNullException(nameof(pathFinder)); } this._pathFinder = pathFinder; if (routeFinder == null) { throw new ArgumentNullException(nameof(routeFinder)); } this._routeFinder = routeFinder; }
public PersonController( IMapper mapper, IServiceInvoker serviceInvoker, IPersonRepository personRepository) : base(mapper, serviceInvoker) { _personRepository = personRepository; }
/// <summary> /// 配置服务调用器 /// </summary> /// <param name="serviceInvoker"></param> /// <returns></returns> public INodeServerBuilder ConfigServiceInvoker(IServiceInvoker serviceInvoker) { CheckIsBuild(); config.ServiceInvoker = serviceInvoker; return(this); }
public SecurityController(ISecurityService securityService, IMapper mapper, IServiceInvoker serviceInvoker, IOptions <JwtIssuerOptions> jwtOptions) : base(mapper, serviceInvoker) { _securityService = securityService; _jwtOptions = jwtOptions.Value; }
public HubEventService(IServiceInvoker serviceInvoker) { if (serviceInvoker == null) { throw new ArgumentNullException(nameof(serviceInvoker)); } this._serviceInvoker = serviceInvoker; }
public PersonController(ICurrentUserService currentUserService, IMapper mapper, IServiceInvoker serviceInvoker, IPersonRepository personRepository) : base(mapper, serviceInvoker) { _currentUserService = currentUserService; _personRepository = personRepository; }
public ScopeContext(string contextPath, IClientRegistry clientRegistry, IScopeResolver scopeResolver, IServiceInvoker serviceInvoker, IPersistenceStore persistanceStore) { this._contextPath = string.Empty; this._contextPath = contextPath; this._clientRegistry = clientRegistry; this._scopeResolver = scopeResolver; this._persistanceStore = persistanceStore; this._serviceInvoker = serviceInvoker; }
internal AsyncState(string key, Action <string> dele, string url, Type serviceInvokerType) { this.key = key; this.url = url; this.WSdele = dele; this.serviceInvokerType = serviceInvokerType; this.serviceInvoker = Activator.CreateInstance(serviceInvokerType) as IServiceInvoker; this.serviceInvoker.Initialize(url); }
/// <summary> /// Initializes a new instance of the /// <see cref="BrowserStackLoginHelper"/> class. /// </summary> public BrowserStackLoginHelper(IAsyncActionsFactory asyncActionsFactory, IInfoService infoService, IServiceInvoker serviceInvoker, IUserCredentials userCredentials, IApolloServicesLocations apolloServicesLocations, ICookieContainerSpecificWebRequestCreator cookieContainerSpecificWebRequestCreator) { mAsyncActionsFactory = asyncActionsFactory; mCookieContainerSpecificWebRequestCreator = cookieContainerSpecificWebRequestCreator; mServiceInvoker = serviceInvoker; mUserCredentials = userCredentials; mApolloServicesLocations = apolloServicesLocations; mInfoService = infoService; }
/// <summary> /// 构造函数 /// </summary> /// <param name="config">NodeServer配置</param> public DefaultNodeServer(NodeServerConfig config) { ValidateConfig(config); logger = LoggerManager.ServerLoggerFactory.CreateLogger <DefaultNodeServer>(); server = config.Communication; protocolStackFactory = config.ProtocolStackFactory; serviceProvider = config.ServiceProvider; RouteManager = config.RouteFactory.CreateRouteManager(); routeDescriptor = config.RouteFactory.CreateRouteDescriptor(); if (config.ServiceConfigs != null) { routeDescriptor.SetServiceConfig(config.ServiceConfigs); } serializer = config.Serializer; serviceInvoker = config.ServiceInvoker; serviceProcessor = config.ServiceProcessor; loginValidator = config.LoginValidator; this.config = config ?? throw new InvalidOperationException("Argument config is null."); }
public async Task InvokeAsync(HttpContext context, IServiceInvoker invoker, ISerializer serializer) { #region 反序列化方法调用信息 var typeName = System.Web.HttpUtility.UrlDecode(context.Request.Headers[HttpClientInvoker.HEADER_SERVICE_NAME].FirstOrDefault()); var methodName = System.Web.HttpUtility.UrlDecode(context.Request.Headers[HttpClientInvoker.HEADER_METHOD_NAME].FirstOrDefault()); var serializedParameters = new StreamReader(context.Request.Body).ReadToEndAsync().Result; var targetType = Type.GetType(typeName); var methodInfo = targetType.GetMethod(methodName); var parameters = serializer.Deserialize(serializedParameters, typeof(object[])) as object[]; #endregion #region 泛化调用 var result = invoker.Call(context.RequestServices, methodInfo, parameters); #endregion #region 反序列化方法返回结果 var serializedResult = serializer.Serialize(result); #endregion await context.Response.WriteAsync(serializedResult); }
internal BillingService(Authentication authentication, IServiceInvoker serviceInvoker) : base(authentication, serviceInvoker) { }
public UsersApiController(IServiceInvoker<IUserService> usersService) { _usersService = usersService; }
public AuthController(IIdentityService identityService, IServiceInvoker serviceInvoker) { _identityService = identityService; _serviceInvoker = serviceInvoker; }
public BoardController(IBoardService boardService, IServiceInvoker serviceInvoker) { _boardService = boardService; _serviceInvoker = serviceInvoker; }
public Pipeline(Type contract, ISerializer serializer, IServiceFactory factory, IServiceInvoker invoker) { this.serializer = serializer; this.serviceFactory = factory; this.contract = contract; }
internal ServerService(Authentication authentication, IServiceInvoker serviceInvoker) : base(authentication, serviceInvoker) { }
/// <summary> /// Initializes a new instance of the <see cref="InvokeController"/> class. /// </summary> /// <param name="serviceInvoker">The service invoker.</param> public InvokeController(IServiceInvoker serviceInvoker) { this.serviceInvoker = serviceInvoker; }
internal AccountService(Authentication authentication, IServiceInvoker serviceInvoker) : base(authentication, serviceInvoker) { }
public CallerCentreService() { this.service = new ServiceInvoker("http://localhost:8080/api/CallerCentre/"); }
internal AuthenticationService(IServiceInvoker serviceInvoker) : base(null, serviceInvoker) { }
internal QueueService(Authentication authentication, IServiceInvoker serviceInvoker) : base(authentication, serviceInvoker) { this.authentication = authentication; }
public DataService(IServiceInvoker ivkService) { this.ivkService = ivkService; }
private void ThreadUploadFile(IServiceInvoker serviceInvoker, string errorId, string fileName, byte[] content) { int numberOfUploadingTimes = 10; bool resultUploading = false; int times = 0; while (times < numberOfUploadingTimes && !resultUploading) { times++; resultUploading = serviceInvoker.UploadErrorFile(System.IO.Path.GetFileName(fileName), content); } if (!resultUploading) { //packageUploadManager.PutPackageBack(packageForUpload.PackageName); } else { uploadingFiles.MarkUploaded(errorId, fileName); System.IO.File.Delete(fileName); } }
protected ApiV1BaseController(IMapper mapper, IServiceInvoker serviceInvoker) : base(mapper, serviceInvoker) { }
public void TryDoUploads() { int k = 100; string errorType = string.Empty; string metaFileName = string.Empty; SummaryField[] summaryItems = new SummaryField[0]; string[] filesUploading = new string[0]; PackageForUpload packageForUpload = packageUploadManager.GetPackageForUpload(maxContentLength, fileExt, out metaFileName, out errorType, out summaryItems, out filesUploading); //ReLoad uploading queue string uploadingQueueFileName = string.Empty; if(filesUploading.Length>0) { uploadingQueueFileName = System.IO.Path.GetDirectoryName(filesUploading[0]); uploadingQueueFileName = uploadingQueueFileName.Substring(0, uploadingQueueFileName.LastIndexOf(@"\")); uploadingQueueFileName = System.IO.Path.Combine(uploadingQueueFileName, "UploadingQueue.xml"); if (System.IO.File.Exists(uploadingQueueFileName)) uploadingFiles = UploadingFileManager.LoadUploadingInfo(uploadingQueueFileName); } while (k-- > 0 && packageForUpload != null) { string errorID = null; try { if (serviceInvoker == null) { serviceInvoker = new WebServiceInvoker(); serviceInvoker.SetServiceUrl(myServiceUrl); } if (filesUploading.Length > 0) { errorID = null; if (uploadingFiles != null) errorID = uploadingFiles.GetErrorIDByFileName(filesUploading[0]); if(errorID == null) { errorID = serviceInvoker.CreateError(metaFileName, errorType, packageForUpload.ShortVersion); } else { serviceInvoker.InitLastErrorInfo(errorID); } if (errorID != null) { if (uploadingFiles == null) { uploadingFiles = new UploadingFiles(errorID, filesUploading); } else { uploadingFiles.AddUploadingFiles(errorID, filesUploading); } //Save the Queue before upload data UploadingFileManager.SaveUploadingInfo(uploadingFiles, uploadingQueueFileName); if(summaryItems.Length > 0) serviceInvoker.InsertSummaryInfo(errorID, summaryItems); #region Upload File int uploadedFilesCount = 0; for (int i = 0; i < filesUploading.Length; i++) { string uploading = filesUploading[i]; //Thread thread = new Thread(new ParameterizedThreadStart(ThreadUploadFile)); //thread.Start(errorID, uploading, FileUtils.GetFileContent(uploading)); int numberOfUploadingTimes = 10; bool resultUploading = false; int times = 0; while (times < numberOfUploadingTimes && !resultUploading) { times++; resultUploading = serviceInvoker.UploadErrorFile(System.IO.Path.GetFileName(uploading), FileUtils.GetFileContent(uploading)); } if (!resultUploading) { //packageUploadManager.PutPackageBack(packageForUpload.PackageName); } else { uploadedFilesCount++; uploadingFiles.MarkUploaded(errorID, uploading); System.IO.File.Delete(uploading); } } #endregion if (uploadedFilesCount > 0) packageUploadManager.MarkFinishedUpload(packageForUpload.PackageName); //Save the Queue again UploadingFileManager.SaveUploadingInfo(uploadingFiles, uploadingQueueFileName); } } } catch (Exception exception) { try { //If the error processed but did not upload any file, we have to push back to upload later. if (errorID == null) { packageUploadManager.PutPackageBack(packageForUpload.PackageName); errorID = "null"; } else { packageUploadManager.MarkFinishedUpload(packageForUpload.PackageName); } ProcessException.Handle(exception,"ApplicationUtils.ErrorReporting.Upload.Uploader.TryDoUpLoad()", string.Format("Uploder.TryDoUploads({0}) Error", errorID)); } catch { } } packageForUpload = packageUploadManager.GetPackageForUpload(maxContentLength, fileExt, out metaFileName, out errorType, out summaryItems, out filesUploading); } return; }
public MembersService() { this.service = new ServiceInvoker("http://localhost:8080/api/MembersService/"); }
internal GroupService(Authentication authentication, IServiceInvoker serviceInvoker, ServerService serverService) : base(authentication, serviceInvoker) { this.serverService = serverService; }
public DataService(IServiceInvoker ivk) { this.invoker = ivk; }
internal AsyncState(string key, Action<string> dele, string url, Type serviceInvokerType) { this.key = key; this.url = url; this.WSdele = dele; this.serviceInvokerType = serviceInvokerType; this.serviceInvoker = Activator.CreateInstance(serviceInvokerType) as IServiceInvoker; this.serviceInvoker.Initialize(url); }
public T Resolve <T>(Authentication authentication, IServiceInvoker serviceInvoker) where T : ServiceBase { return(DefaultServiceResolver.ResolveImpl <T>(authentication, serviceInvoker)); }
public DotNettySocketService(IServiceInvoker invoker, ITransportMessageCodecFactory codecFactory, ILogger <DotNettySocketService> logger) { _encoder = codecFactory.CreateEncoder(); _invoker = invoker; _logger = logger; }
protected ServiceBase(Authentication authentication, IServiceInvoker serviceInvoker) { this.authentication = authentication; this.serviceInvoker = serviceInvoker; }
protected ApiBaseController(IMapper mapper, IServiceInvoker serviceInvoker) { Mapper = mapper; ServiceInvoker = serviceInvoker; }