Example #1
0
 public CfHandler(IServiceActivator activator, IServiceInvoker invoker, ILogger logger, IQueue queue)
 {
     _activator = activator;
     _invoker   = invoker;
     _logger    = logger;
     _queue     = queue;
 }
Example #2
0
 internal DataCenterService(Authentication authentication, IServiceInvoker serviceInvoker, GroupService groupService, AccountService accountService, BillingService billingService)
     : base(authentication, serviceInvoker)
 {
     this.groupService   = groupService;
     this.accountService = accountService;
     this.billingService = billingService;
 }
Example #3
0
		public ScopeContext(string contextPath, IClientRegistry clientRegistry, IScopeResolver scopeResolver, IServiceInvoker serviceInvoker, IPersistenceStore persistanceStore) {
			_contextPath = contextPath;
			_clientRegistry = clientRegistry;
			_scopeResolver = scopeResolver;
			_persistanceStore = persistanceStore;
			_serviceInvoker = serviceInvoker;
		}
Example #4
0
 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 RequestProcessor(JsonSerializer serializer, IServiceFactory serviceFactory, IServiceCatalog services, IServiceInvoker serviceInvoker)
 {
     this.serializer = serializer;
     this.serviceFactory = serviceFactory;
     this.services = services;
     this.serviceInvoker = serviceInvoker;
 }
Example #6
0
        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;
 }
Example #8
0
 public ScopeContext(string contextPath, IClientRegistry clientRegistry, IScopeResolver scopeResolver, IServiceInvoker serviceInvoker, IPersistenceStore persistanceStore)
 {
     _contextPath      = contextPath;
     _clientRegistry   = clientRegistry;
     _scopeResolver    = scopeResolver;
     _persistanceStore = persistanceStore;
     _serviceInvoker   = serviceInvoker;
 }
Example #9
0
        /// <summary>
        /// 配置服务调用器
        /// </summary>
        /// <param name="serviceInvoker"></param>
        /// <returns></returns>
        public INodeServerBuilder ConfigServiceInvoker(IServiceInvoker serviceInvoker)
        {
            CheckIsBuild();

            config.ServiceInvoker = serviceInvoker;

            return(this);
        }
Example #10
0
 public SecurityController(ISecurityService securityService,
                           IMapper mapper,
                           IServiceInvoker serviceInvoker,
                           IOptions <JwtIssuerOptions> jwtOptions) : base(mapper, serviceInvoker)
 {
     _securityService = securityService;
     _jwtOptions      = jwtOptions.Value;
 }
Example #11
0
 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;
 }
Example #13
0
 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;
 }
Example #14
0
 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;
 }
Example #16
0
 /// <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;
 }
Example #17
0
 /// <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.");
 }
Example #18
0
        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);
        }
Example #19
0
 internal BillingService(Authentication authentication, IServiceInvoker serviceInvoker)
     : base(authentication, serviceInvoker)
 {
 }
 public UsersApiController(IServiceInvoker<IUserService> usersService)
 {
     _usersService = usersService;
 }
Example #21
0
 public AuthController(IIdentityService identityService, IServiceInvoker serviceInvoker)
 {
     _identityService = identityService;
     _serviceInvoker  = serviceInvoker;
 }
Example #22
0
 public BoardController(IBoardService boardService, IServiceInvoker serviceInvoker)
 {
     _boardService   = boardService;
     _serviceInvoker = serviceInvoker;
 }
Example #23
0
 public Pipeline(Type contract, ISerializer serializer, IServiceFactory factory, IServiceInvoker invoker)
 {
     this.serializer     = serializer;
     this.serviceFactory = factory;
     this.contract       = contract;
 }
Example #24
0
 internal ServerService(Authentication authentication, IServiceInvoker serviceInvoker)
     : base(authentication, serviceInvoker)
 {
 }
Example #25
0
 /// <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;
 }
Example #26
0
        internal AccountService(Authentication authentication, IServiceInvoker serviceInvoker)
            : base(authentication, serviceInvoker)
        {

        }
Example #27
0
        internal ServerService(Authentication authentication, IServiceInvoker serviceInvoker)
            : base(authentication, serviceInvoker)
        {

        }
Example #28
0
 public CallerCentreService()
 {
     this.service = new ServiceInvoker("http://localhost:8080/api/CallerCentre/");
 }
 internal AuthenticationService(IServiceInvoker serviceInvoker)
     : base(null, serviceInvoker)
 {
 }
Example #30
0
 internal QueueService(Authentication authentication, IServiceInvoker serviceInvoker)
     : base(authentication, serviceInvoker)
 {
     this.authentication = authentication;
 }
Example #31
0
 internal QueueService(Authentication authentication, IServiceInvoker serviceInvoker)
     : base(authentication, serviceInvoker)
 {
     this.authentication = authentication;
 }
 public DataService(IServiceInvoker ivkService)
 {
     this.ivkService = ivkService;
 }
Example #33
0
		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);
			}
		}
Example #34
0
 protected ApiV1BaseController(IMapper mapper, IServiceInvoker serviceInvoker) : base(mapper, serviceInvoker)
 {
 }
Example #35
0
		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;
		}
Example #36
0
 public MembersService()
 {
     this.service = new ServiceInvoker("http://localhost:8080/api/MembersService/");
 }
Example #37
0
 internal GroupService(Authentication authentication, IServiceInvoker serviceInvoker, ServerService serverService)
     : base(authentication, serviceInvoker)
 {
     this.serverService = serverService;
 }
 internal AuthenticationService(IServiceInvoker serviceInvoker)
     : base(null, serviceInvoker)
 {
 }
 public DataService(IServiceInvoker ivk)
 {
     this.invoker = ivk;
 }
Example #40
0
 internal AccountService(Authentication authentication, IServiceInvoker serviceInvoker)
     : base(authentication, serviceInvoker)
 {
 }
Example #41
0
 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));
 }
Example #43
0
 public DotNettySocketService(IServiceInvoker invoker, ITransportMessageCodecFactory codecFactory, ILogger <DotNettySocketService> logger)
 {
     _encoder = codecFactory.CreateEncoder();
     _invoker = invoker;
     _logger  = logger;
 }
Example #44
0
 protected ServiceBase(Authentication authentication, IServiceInvoker serviceInvoker)
 {
     this.authentication = authentication;
     this.serviceInvoker = serviceInvoker;
 }
Example #45
0
 internal GroupService(Authentication authentication, IServiceInvoker serviceInvoker, ServerService serverService)
     : base(authentication, serviceInvoker)
 {
     this.serverService = serverService;
 }
Example #46
0
 protected ApiBaseController(IMapper mapper, IServiceInvoker serviceInvoker)
 {
     Mapper         = mapper;
     ServiceInvoker = serviceInvoker;
 }