コード例 #1
0
 public DeleteEntityCommand(ApiController controller, string id, DeleteProcessingModel model, ITaskProvider taskProvider, ITaskChecker taskChecker) : base(controller)
 {
     _id           = id;
     _model        = model;
     _taskProvider = taskProvider;
     _taskChecker  = taskChecker;
 }
コード例 #2
0
 public static void CleanupFactory()
 {
     _backgroundScanner = null;
     _buildManager      = null;
     _taskProvider      = null;
     _projectStores.Clear();
 }
コード例 #3
0
 public QualityAccidentService(
     IAuthInfoProvider authInfoProvider,
     IAppRepositoryBase <QualityAccident> accidentRepository,
     IAppRepositoryBase <QualityAccidentDisposal> disposalRepository,
     //  IAppRepositoryBase<Project> projectRepository,
     IAppDbContextProvider dbContextProvider,
     IDbOperator op,
     IEventBus eventBus,
     IWfEngine wfEngine,
     IProjectHelper projectHelper
     )
 {
     _projectHelper      = projectHelper;
     _authInfoProvider   = authInfoProvider;
     _accidentRepository = accidentRepository;
     _disposalRepository = disposalRepository;
     // _projectRepository = projectRepository;
     _dbContextProvider = dbContextProvider;
     _eventBus          = eventBus;
     _op = op;
     _runtimeProvider   = wfEngine.GetRuntimeProvider();
     _taskProvider      = wfEngine.GetTaskProvider();
     _definitionProvder = wfEngine.GetDefinitionProvider();
     _historyProvider   = wfEngine.GetHistoryProvider();
 }
コード例 #4
0
ファイル: TestRunnerService.cs プロジェクト: tokarthik/Meissa
 public TestRunnerService(
     IServiceClient <TestRunDto> testRunRepository,
     IServiceClient <TestRunLogDto> testRunLogRepository,
     IProcessProvider processStarter,
     IFileProvider fileProvider,
     IDirectoryProvider directoryProvider,
     IPathProvider pathProvider,
     IConsoleProvider consoleProvider,
     ITestsRunnerTestResultsService testResultsService,
     IJsonSerializer jsonSerializer,
     ITestCasesHistoryService testCasesHistoryService,
     ITaskProvider taskProvider,
     IPluginService pluginService,
     ITestRunLogService testRunLogService,
     IDateTimeProvider dateTimeProvider,
     IEnvironmentService environmentService)
 {
     _testRunRepository       = testRunRepository;
     _testRunLogRepository    = testRunLogRepository;
     _processStarter          = processStarter;
     _fileProvider            = fileProvider;
     _directoryProvider       = directoryProvider;
     _pathProvider            = pathProvider;
     _consoleProvider         = consoleProvider;
     _testResultsService      = testResultsService;
     _jsonSerializer          = jsonSerializer;
     _testCasesHistoryService = testCasesHistoryService;
     _taskProvider            = taskProvider;
     _pluginService           = pluginService;
     _testRunLogService       = testRunLogService;
     _dateTimeProvider        = dateTimeProvider;
     _environmentService      = environmentService;
 }
コード例 #5
0
        public HomeController(IContestsProvider contestsProvider,
                              ITaskProvider archivedTaskProvider,
                              IPostProvider postProvider,
                              IUsersProvider usersProvider,
                              ICompetitorProvider competitorProvider)
        {
            if (contestsProvider == null)
            {
                throw new ArgumentNullException("contestsProvider");
            }
            if (archivedTaskProvider == null)
            {
                throw new ArgumentNullException("archivedTaskProvider");
            }
            if (postProvider == null)
            {
                throw new ArgumentNullException("postProvider");
            }
            if (usersProvider == null)
            {
                throw new ArgumentNullException("usersProvider");
            }
            if (competitorProvider == null)
            {
                throw new ArgumentNullException("competitorProvider");
            }

            _contestsProvider     = contestsProvider;
            _archivedTaskProvider = archivedTaskProvider;
            _postProvider         = postProvider;
            _usersProvider        = usersProvider;
            _competitorProvider   = competitorProvider;
        }
コード例 #6
0
 public ProjectService(
     IAppRepositoryBase <Project> projectRepository,
     IAppRepositoryBase <ProjectUnit> projectUnitRepository,
     IAuthInfoProvider authInfoProvider,
     IWfEngine wfEngine,
     IAuthorizationRepositoryBase <User> userRepository,
     IAuthorizationRepositoryBase <UserUnit> userUnitRepository,
     IAppDbContextProvider dbContextProvider,
     IMessagingProvider messagingProvider,
     IProjectHelper projectHelper
     )
 {
     _projectHelper         = projectHelper;
     _messagingProvider     = messagingProvider;
     _authInfoProvider      = authInfoProvider;
     _userRepository        = userRepository;
     _userUnitRepository    = userUnitRepository;
     _runtimeProvider       = wfEngine.GetRuntimeProvider();
     _taskProvider          = wfEngine.GetTaskProvider();
     _definitionProvder     = wfEngine.GetDefinitionProvider();
     _historyProvider       = wfEngine.GetHistoryProvider();
     _dbContextProvider     = dbContextProvider;
     _projectRepository     = projectRepository;
     _projectUnitRepository = projectUnitRepository;
 }
コード例 #7
0
 public UpdateEntityCommand(ApiController controller, string id, UpdateProcessingModel model, ITaskProvider taskKeeper)
     : base(controller)
 {
     _id         = id;
     _model      = model;
     _taskKeeper = taskKeeper;
 }
コード例 #8
0
 public QualityProblemService(
     IAuthInfoProvider authInfoProvider,
     IAppRepositoryBase <QualityProblem> problemRepository,
     IAppRepositoryBase <QualityProblemRectification> rectificationRepository,
     // IAppRepositoryBase<Project> projectRepository,
     IAppDbContextProvider dbContextProvider,
     IDbOperator op,
     IEventBus eventBus,
     IWfEngine wfEngine,
     IProjectHelper projectHelper
     )
 {
     _projectHelper           = projectHelper;
     _authInfoProvider        = authInfoProvider;
     _problemRepository       = problemRepository;
     _rectificationRepository = rectificationRepository;
     //_projectRepository = projectRepository;
     _dbContextProvider = dbContextProvider;
     _eventBus          = eventBus;
     _op = op;
     _runtimeProvider   = wfEngine.GetRuntimeProvider();
     _taskProvider      = wfEngine.GetTaskProvider();
     _definitionProvder = wfEngine.GetDefinitionProvider();
     _historyProvider   = wfEngine.GetHistoryProvider();
 }
コード例 #9
0
 public static ITaskProvider GetTaskProvider()
 {
     if (_taskProvider == null)
     {
         _taskProvider = new TaskProvider(_serviceProvider);
     }
     return(_taskProvider);
 }
コード例 #10
0
ファイル: Worker.cs プロジェクト: ada3000/FixedTheadPool
        public Worker(ITaskProvider taskProvider)
        {
            _taskProvider = taskProvider;

            _worker = new Thread(DoWork);
            _worker.IsBackground = true;
            _worker.Start();
        }
コード例 #11
0
 public TaskService(
     IWfEngine wfEgine,
     IAuthInfoProvider authInfoProvider)
 {
     _taskProvider     = wfEgine.GetTaskProvider();
     _historyProvider  = wfEgine.GetHistoryProvider();
     _authInfoProvider = authInfoProvider;
 }
コード例 #12
0
 public static ITaskProvider GetTaskProvider()
 {
     if (_taskProvider == null)
     {
         _taskProvider = new TaskProvider(_serviceProvider);
     }
     return _taskProvider;
 }
コード例 #13
0
ファイル: TaskView.xaml.cs プロジェクト: kapitanov/diploma
 private void CompleteTask_Click(object sender, RoutedEventArgs e)
 {
     Async(() =>
     {
         taskProvider.CompleteTask(task.Id);
         taskProvider = new TaskProviderClientFactory().CreateClient();
     });
     ViewMode_NoTask();
 }
コード例 #14
0
        //For bootstrap mapping
        //public TaskController(ITaskProvider taskProvider)
        //{
        //    _taskProvider = taskProvider;
        //}

        //For internal mapping
        public TaskController()
        {
            if (FlagCheckProvider.Instance.IsPreview(Constants.FeatureFlags.TaskProvider))
            {
                _taskProvider = (ITaskProvider)TinyIoCContainer.Current.Resolve <ITaskv2Provider>();
            }
            else
            {
                _taskProvider = (ITaskProvider)TinyIoCContainer.Current.Resolve <ITaskv1Provider>();
            }
        }
コード例 #15
0
ファイル: Job.cs プロジェクト: azekeal/distributed
        public Job(Distributed.Dispatcher dispatcher, ITaskProvider taskProvider, int priority)
        {
            using (Trace.Log())
            {
                this.Dispatcher               = dispatcher;
                this.Name                     = $"job_{Guid.NewGuid()}";
                this.Priority                 = priority;
                this.TaskCount                = taskProvider.TaskCount;
                this.taskProvider             = taskProvider;
                this.taskProvider.TasksAdded += NotifyTasksAvailable;

                stats.pending = taskProvider.TaskCount;
            }
        }
コード例 #16
0
 public ContractPaymentService(
     IAuthInfoProvider authInfoProvider,
     IAppRepositoryBase <ContractPayment> contractPaymentRepository,
     IAppDbContextProvider dbContextProvider,
     IWfEngine wfEngine
     )
 {
     _authInfoProvider          = authInfoProvider;
     _contractPaymentRepository = contractPaymentRepository;
     _dbContextProvider         = dbContextProvider;
     _runtimeProvider           = wfEngine.GetRuntimeProvider();
     _taskProvider      = wfEngine.GetTaskProvider();
     _definitionProvder = wfEngine.GetDefinitionProvider();
     _historyProvider   = wfEngine.GetHistoryProvider();
 }
コード例 #17
0
ファイル: Dispatcher.cs プロジェクト: azekeal/distributed
        public void AddJob(ITaskProvider taskProvider, int priority = 0)
        {
            using (Trace.Log())
            {
                lock (jobQueue)
                {
                    jobQueue.Add(priority, new Job(this, taskProvider, priority));
                }

                if (ActiveJob == null)
                {
                    StartNextJob();
                }
            }
        }
コード例 #18
0
        public TaskController(
            IGraphSdkHelper graphSdkHelper,
            IRootConfigurationProvider rootConfigurationProvider,
            ITaskProvider taskProvider) : base(graphSdkHelper)
        {
            // Get from config
            var appOptions = rootConfigurationProvider.GeneralConfiguration;

            ProposalManagerApiUrl = appOptions.ProposalManagerApiUrl;
            SiteId = appOptions.SiteId;

            httpHelper = graphSdkHelper;

            this.taskProvider = taskProvider;
        }
コード例 #19
0
ファイル: AutoSubmit.cs プロジェクト: weiliji/NFMT
        public NFMT.Common.ResultModel Submit(UserModel user, IModel obj, ITaskProvider taskProvider, MasterEnum masterEnum)
        {
            ResultModel result = new ResultModel();

            //提交审核
            NFMT.WorkFlow.BLL.FlowMasterBLL flowMasterBLL = new NFMT.WorkFlow.BLL.FlowMasterBLL();
            result = flowMasterBLL.Get(user, (int)masterEnum);
            if (result.ResultStatus != 0)
                return result;
            NFMT.WorkFlow.Model.FlowMaster flowMaster = result.ReturnValue as NFMT.WorkFlow.Model.FlowMaster;

            NFMT.WorkFlow.Model.DataSource source = new NFMT.WorkFlow.Model.DataSource()
            {
                BaseName = obj.DataBaseName,
                TableCode = obj.TableName,
                DataStatus = NFMT.Common.StatusEnum.待审核,
                RowId = obj.Id,
                ViewUrl = flowMaster.ViewUrl,
                EmpId = user.EmpId,
                ApplyTime = DateTime.Now,
                ApplyTitle = string.Empty,
                ApplyMemo = string.Empty,
                ApplyInfo = string.Empty,
                ConditionUrl = flowMaster.ConditionUrl,
                RefusalUrl = flowMaster.RefusalUrl,
                SuccessUrl = flowMaster.SuccessUrl,
                DalName = obj.DalName,
                AssName = obj.AssName
            };

            result = taskProvider.Create(user,obj);
            if (result.ResultStatus != 0)
                return result;

            NFMT.WorkFlow.Model.Task task = result.ReturnValue as NFMT.WorkFlow.Model.Task;
            if (task == null)
            {
                result.ResultStatus = -1;
                result.Message = "创建任务失败";
                return result;
            }
            task.MasterId = flowMaster.MasterId;

            NFMT.WorkFlow.FlowOperate flowOperate = new NFMT.WorkFlow.FlowOperate();
            result = flowOperate.AuditAndCreateTask(user, obj, flowMaster, source, task);

            return result;
        }
コード例 #20
0
        public TaskService(ITaskProvider taskProvider,
                           ISettingService settingService)
        {
            _taskProvider = taskProvider;

            _settingService = settingService;

            _selectors = new Dictionary <string, Func <Task, object> >
            {
                { "Name", FuncTaskNameKeySelector },
                { "Priority", FuncTaskPriorityKeySelector },
                { "TimeCreate", FuncTaskTimeCreateKeySelector },
                { "TimeToComplete", FuncTaskTimeToCompleteKeySelector },
                { "Status", FuncTaskStatusKeySelector }
            };
        }
コード例 #21
0
 public TestAgentRunProvider(
     IServiceClient <TestRunDto> testRunRepository,
     ITestRunOutputServiceClient testRunOutputServiceClient,
     IServiceClient <TestAgentDto> testAgentRepository,
     IServiceClient <TestAgentRunDto> testAgentRunRepository,
     IServiceClient <TestRunCustomArgumentDto> testRunCustomArgumentRepository,
     ITestsRunnerService nativeTestsRunner,
     ITestAgentsLoggerService testAgentsLoggerService,
     IDistributeLogger logger,
     ITestAgentStateSwitcher testAgentStateSwitcher,
     IPathProvider pathProvider,
     IFileProvider fileProvider,
     IConsoleProvider consoleProvider,
     IEnvironmentService environmentService,
     IGuidService guidService,
     IPluginService pluginService,
     IDateTimeProvider dateTimeProvider,
     ITaskProvider taskProvider,
     ITestRunLogService testRunLogService,
     ITestAgentRunAvailabilityServiceClient testAgentRunAvailabilityServiceClient,
     ITestRunAvailabilityServiceClient testRunAvailabilityServiceClient,
     IDirectoryProvider directoryProvider)
 {
     _testRunRepository               = testRunRepository;
     _testRunOutputServiceClient      = testRunOutputServiceClient;
     _testAgentRepository             = testAgentRepository;
     _testAgentRunRepository          = testAgentRunRepository;
     _testRunCustomArgumentRepository = testRunCustomArgumentRepository;
     _nativeTestsRunner               = nativeTestsRunner;
     _testAgentsLoggerService         = testAgentsLoggerService;
     _logger = logger;
     _testAgentStateSwitcher = testAgentStateSwitcher;
     _consoleProvider        = consoleProvider;
     _pathProvider           = pathProvider;
     _fileProvider           = fileProvider;
     _environmentService     = environmentService;
     _guidService            = guidService;
     _pluginService          = pluginService;
     _dateTimeProvider       = dateTimeProvider;
     _taskProvider           = taskProvider;
     _testRunLogService      = testRunLogService;
     _testAgentRunAvailabilityServiceClient = testAgentRunAvailabilityServiceClient;
     _testRunAvailabilityServiceClient      = testRunAvailabilityServiceClient;
     _directoryProvider        = directoryProvider;
     _wasTestAgentRunCompleted = false;
 }
コード例 #22
0
ファイル: AutobotBase.cs プロジェクト: teize001/Crema
 private void InvokeTask(MethodInfo method, ITaskProvider taskProvider, object target)
 {
     try
     {
         if (method != null)
         {
             method.Invoke(taskProvider, new object[] { target, this.taskContext });
         }
     }
     catch
     {
     }
     finally
     {
         this.taskContext.DoTask();
     }
 }
コード例 #23
0
 public EarlyStageService(
     IAuthInfoProvider authInfoProvider,
     IAppRepositoryBase <EarlyStage> earlyStageRepository,
     IAppDbContextProvider dbContextProvider,
     IEventBus eventBus,
     IWfEngine wfEngine
     )
 {
     _authInfoProvider     = authInfoProvider;
     _earlyStageRepository = earlyStageRepository;
     _dbContextProvider    = dbContextProvider;
     _eventBus             = eventBus;
     _runtimeProvider      = wfEngine.GetRuntimeProvider();
     _taskProvider         = wfEngine.GetTaskProvider();
     _definitionProvder    = wfEngine.GetDefinitionProvider();
     _historyProvider      = wfEngine.GetHistoryProvider();
 }
コード例 #24
0
 public RecordService(
     IAppRepositoryBase <Record> recordRepository,
     IAuthInfoProvider authInfoProvider,
     IWfEngine wfEngine,
     IAuthorizationRepositoryBase <User> userRepository,
     IAppDbContextProvider dbContextProvider,
     IMessagingProvider messagingProvider)
 {
     _recordRepository  = recordRepository;
     _messagingProvider = messagingProvider;
     _authInfoProvider  = authInfoProvider;
     _userRepository    = userRepository;
     _runtimeProvider   = wfEngine.GetRuntimeProvider();
     _taskProvider      = wfEngine.GetTaskProvider();
     _definitionProvder = wfEngine.GetDefinitionProvider();
     _historyProvider   = wfEngine.GetHistoryProvider();
     _dbContextProvider = dbContextProvider;
 }
コード例 #25
0
ファイル: AutobotBase.cs プロジェクト: teize001/Crema
        private static MethodInfo RandomMethod(ITaskProvider taskProvider)
        {
            var weight  = RandomUtility.Next(100) + 1;
            var methods = taskProvider.GetType().GetMethods();

            return(methods.RandomOrDefault((item) => Predicate(item)));

            bool Predicate(MethodInfo methodInfo)
            {
                if (methodInfo.IsStatic == true)
                {
                    return(false);
                }

                if (methodInfo.ReturnType != typeof(void))
                {
                    return(false);
                }

                var attr = methodInfo.GetCustomAttribute <TaskMethodAttribute>();

                if (attr == null)
                {
                    return(false);
                }

                if (attr.Weight < weight)
                {
                    return(false);
                }

                var parameters = methodInfo.GetParameters();

                if (parameters.Count() != 2)
                {
                    return(false);
                }

                return(parameters[1].ParameterType == typeof(TaskContext));
            }
        }
コード例 #26
0
 public ProjectTaskService(
     IAppRepositoryBase <ProjectTask> taskRepository,
     IAppRepositoryBase <ProjectGantt> ganttRepository,
     IAuthInfoProvider authInfoProvider,
     IWfEngine wfEngine,
     IAuthorizationRepositoryBase <User> userRepository,
     IAppDbContextProvider dbContextProvider,
     IProjectHelper projectHelper
     )
 {
     _ganttRepository       = ganttRepository;
     _projectHelper         = projectHelper;
     _authInfoProvider      = authInfoProvider;
     _userRepository        = userRepository;
     _runtimeProvider       = wfEngine.GetRuntimeProvider();
     _taskProvider          = wfEngine.GetTaskProvider();
     _definitionProvder     = wfEngine.GetDefinitionProvider();
     _historyProvider       = wfEngine.GetHistoryProvider();
     _dbContextProvider     = dbContextProvider;
     _projectTaskRepository = taskRepository;
 }
コード例 #27
0
        public MemorabiliaRecordService(
            IAuthInfoProvider authInfoProvider,
            IWfEngine wfEngine,
            IAppRepositoryBase <MemorabiliaRecord> recordRepository,
            //IAppRepositoryBase<Project> projectRepository,
            IAppDbContextProvider dbContextProvider,
            IProjectHelper projectHelper


            )
        {
            _projectHelper    = projectHelper;
            _authInfoProvider = authInfoProvider;
            _recordRepository = recordRepository;
            // _projectRepository = projectRepository;
            _dbContextProvider = dbContextProvider;
            _runtimeProvider   = wfEngine.GetRuntimeProvider();
            _taskProvider      = wfEngine.GetTaskProvider();
            _definitionProvder = wfEngine.GetDefinitionProvider();
            _historyProvider   = wfEngine.GetHistoryProvider();
        }
コード例 #28
0
        public JobManager(
            BatchCredentials batchCredentials,
            StorageCredentials storageCredentials,
            ITaskProvider taskProvider)
        {
            _batchClient = BatchClient.Open(
                new BatchSharedKeyCredentials(
                    batchCredentials.Url,
                    batchCredentials.Account,
                    batchCredentials.Key));

            _batchClient.CustomBehaviors.Add(
                RetryPolicyProvider.LinearRetryProvider(TimeSpan.FromSeconds(3), 10));

            _taskProvider = taskProvider;

            _storageAccount = new CloudStorageAccount(
                new Microsoft.WindowsAzure.Storage.Auth.StorageCredentials(
                    storageCredentials.Account,
                    storageCredentials.Key),
                true);
        }
コード例 #29
0
 public TestAgentsLoggerService(IServiceClient <TestRunLogDto> testRunLogRepository, ITaskProvider taskProvider, IConsoleProvider consoleProvider)
 {
     _testRunLogRepository = testRunLogRepository;
     _taskProvider         = taskProvider;
     _consoleProvider      = consoleProvider;
 }
コード例 #30
0
 public VideoController(ITaskProvider taskProvider, ITaskChecker taskChecker)
 {
     _taskProvider = taskProvider;
     _taskChecker = taskChecker;
 }
コード例 #31
0
 public FileSystemWatchingRunner(INotificationService notificationService, ITaskProvider taskProvider)
 {
     this.notificationService = notificationService;
     this.taskProvider = taskProvider;
     this.taskRunner = new TaskRunner();
 }
コード例 #32
0
 public TasksController(ITaskProvider taskKeeper)
 {
     _taskKeeper = taskKeeper;
 }
コード例 #33
0
 public TaskConfiguration(ITaskProvider provider)
 {
     TaskProvider = provider;
 }
コード例 #34
0
 public TasksController(ITaskProvider provider)
 {
     this.provider = provider;
 }
コード例 #35
0
 public ScreenshotController(ITaskProvider taskProvider, ITaskChecker taskChecker)
 {
     _taskProvider = taskProvider;
     _taskChecker  = taskChecker;
 }
コード例 #36
0
ファイル: GeneralCore.cs プロジェクト: kapitanov/diploma
 private ExecutionResult ReportReject(ITaskProvider taskProvider, Task task)
 {
     taskProvider.RejectTask(task.Id);
     return ExecutionResult.Rejected(task.Id);
 }
コード例 #37
0
 public TaskPlanner(ITaskProvider taskProvider, ITaskExecutor taskExecutor, IUserNotifier userNotifier)
 {
     _taskProvider = taskProvider;
     _taskExecutor = taskExecutor;
     _userNotifier = userNotifier;
 }
コード例 #38
0
 public TaskConfiguration(ITaskProvider provider) {
     TaskProvider = provider;
 }
コード例 #39
0
ファイル: TaskView.xaml.cs プロジェクト: kapitanov/diploma
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Async(() =>
            {
                taskProvider = new TaskProviderClientFactory().CreateClient();

                Dispatcher.Invoke((Action)(() =>
                {
                    splash.Visibility = Visibility.Hidden;
                    ViewMode_NoTask();
                }));
            });
        }
コード例 #40
0
ファイル: MainViewModel.cs プロジェクト: aytacozkan/tasx
 public MainViewModel(ITaskProvider provider)
 {
     _provider = provider;
 }
コード例 #41
0
ファイル: TaskController.cs プロジェクト: Eimovas/Todo.Test
 public TaskController(ITaskProvider taskProvider)
 {
     if (taskProvider == null) throw new ArgumentNullException(nameof(taskProvider));
     _taskProvider = taskProvider;
 }
コード例 #42
0
 public static void CleanupFactory()
 {
     _backgroundScanner = null;
     _buildManager = null;
     _taskProvider = null;
     _projectStores.Clear();
 }
コード例 #43
0
ファイル: GeneralCore.cs プロジェクト: kapitanov/diploma
 private ExecutionResult ReportSuccess(ITaskProvider taskProvider, Task task)
 {
     taskProvider.CompleteTask(task.Id);
     return ExecutionResult.Success(task.Id);
 }
コード例 #44
0
ファイル: Task.cs プロジェクト: aytacozkan/tasx
 protected Task(ITaskProvider provider)
 {
     Provider = provider;
 }
コード例 #45
0
 public TestPersonDataProvider()
 {
     _taskProvider = new TestTaskProvider();
     _workDayProvider = new TestPortalWorkDayProvider();
 }
コード例 #46
0
 public ScreenshotController(ITaskProvider taskProvider, ITaskChecker taskChecker)
 {
     _taskProvider = taskProvider;
     _taskChecker = taskChecker;
 }
コード例 #47
0
ファイル: GeneralCore.cs プロジェクト: kapitanov/diploma
        private void ExecutionLoop(ITaskProvider taskProvider, IRepository repository)
        {
            while (true)
            {
                status.CurrentTask = null;
                status.Status = ExecutionStatus.WaitingForTask;
                engine.SystemResources = systemResources;
                engine.Repository = wrapperFactory.CreateWrapper(repository);
                Task task;
                try
                {
                    task = taskProvider.GetTask();
                    if(task == null)
                        continue;
                }
                catch (TimeoutException)
                {
                    (taskProvider as ITaskProviderChannel).Abort();
                    return;
                }

                var interval = taskProvider.QueryNotifyInterval();
                using (new Timer(
                    x => OnTimer((Tuple<ITaskProvider, Guid>) x),
                    Tuple.Create(taskProvider, task.Id),
                    TimeSpan.Zero,
                    interval))
                {
                    status.CurrentTask = task;
                    status.Status = ExecutionStatus.ProcessingTask;
                    try
                    {
                        using (Perfomance.Trace("GeneralCore::StartExecution()").BindToTrace())
                        {
                            engine.ExecuteTask(task);
                        }
                        ReportSuccess(taskProvider, task);
                    }
                    catch (TaskRejectedException)
                    {
                        ReportReject(taskProvider, task);
                    }
                    catch (TaskFailedException e)
                    {
                        ReportFailure(taskProvider, task, ErrorSource.Task, e.InnerException);
                    }
                    catch (Exception e)
                    {
                        ReportFailure(taskProvider, task, ErrorSource.Engine, e.InnerException);
                    }
                }
            }
        }
コード例 #48
0
 public PersonDataProvider(ITaskProvider taskProvider, IWorkDayProvider workDayProvider)
 {
     _taskProvider = taskProvider;
     _workDayProvider = workDayProvider;
 }
コード例 #49
0
ファイル: GeneralCore.cs プロジェクト: kapitanov/diploma
 private ExecutionResult ReportFailure(ITaskProvider taskProvider, Task task, ErrorSource source, Exception error)
 {
     taskProvider.FailTask(task.Id, new ErrorReport(task, error, source));
     return ExecutionResult.Failed(task.Id);
 }
コード例 #50
0
 public ProjectDataProviders()
 {
     _workDayProvider = new PortalWorkTimeProvider();
     _taskProvider = new AtlassianJiraTaskProvider();
 }