Ejemplo n.º 1
0
 /// <summary>
 /// 启用任务调度
 /// 启动调度时会把任务表中状态为“执行中”的任务加入到任务调度队列中
 /// </summary>
 public static void StartScheduler()
 {
     try
     {
         DependencyConfig.Register();
         using (var timeScope = DependencyConfig.Container.BeginLifetimeScope())
         {
             _jobTaskRepository = timeScope.Resolve <IJobTaskRepository>();
             if (TaskManager.scheduler != null)
             {
                 //获取所有执行中的任务
                 List <JobTask> listTask = _jobTaskRepository.GetList();
                 if (listTask != null && listTask.Count > 0)
                 {
                     foreach (JobTask taskUtil in listTask)
                     {
                         try
                         {
                             ScheduleJob(taskUtil);
                         }
                         catch (Exception e)
                         {
                             LogHelper.WriteLog(string.Format("任务“{0}”启动失败!", taskUtil.TaskName), e);
                         }
                     }
                 }
                 LogHelper.WriteLog("任务调度启动成功!");
             }
         }
     }
     catch (Exception ex)
     {
         LogHelper.WriteLog("任务调度启动失败!", ex);
     }
 }
Ejemplo n.º 2
0
 public DeleteJobTaskUseCase(IJobTaskRepository taskRepository, IJobOwnerShipValidator jobOwnerShipValidator,
                             IApplicationErrorFactory applicationErrorFactory)
 {
     this.taskRepository          = taskRepository;
     this.jobOwnerShipValidator   = jobOwnerShipValidator;
     this.applicationErrorFactory = applicationErrorFactory;
 }
Ejemplo n.º 3
0
 public UpdateJobTaskUseCase(IJobTaskRepository taskRepository, IJobOwnerShipValidator jobOwnerShipValidator,
                             IApplicationErrorFactory applicationErrorFactory, IMapper mapper)
 {
     this.taskRepository          = taskRepository;
     this.jobOwnerShipValidator   = jobOwnerShipValidator;
     this.applicationErrorFactory = applicationErrorFactory;
     this.mapper = mapper;
 }
Ejemplo n.º 4
0
 public FinishJobTaskUseCase(
     IJobTaskRepository jobTaskRepository,
     IApplicationErrorFactory applicationErrorFactory,
     ITaskAssignedValidator taskAssignedValidator)
 {
     this.jobTaskRepository       = jobTaskRepository;
     this.applicationErrorFactory = applicationErrorFactory;
     this.taskAssignedValidator   = taskAssignedValidator;
 }
Ejemplo n.º 5
0
 public UnAssignJobTaskUseCase(
     IJobTaskRepository jobTaskRepository,
     IJobOwnerShipValidator jobOwnerShipValidator,
     IApplicationErrorFactory applicationErrorFactory)
 {
     this.jobTaskRepository       = jobTaskRepository;
     this.jobOwnerShipValidator   = jobOwnerShipValidator;
     this.applicationErrorFactory = applicationErrorFactory;
 }
Ejemplo n.º 6
0
 public GetJobTaskDetailQueryHandler(IJobTaskRepository repo)
 {
     _repo = repo;
 }
 public CreateJobTaskCommandHandler(IJobTaskRepository jobTaskRepository)
 {
     _jobTaskRepository = jobTaskRepository;
 }
Ejemplo n.º 8
0
 public RemoveResourcesCommandHandler(IJobTaskRepository repo)
 {
     _repo = repo;
 }
Ejemplo n.º 9
0
 public AssignWorkersCommandHandler(IJobTaskRepository repo)
 {
     _repo = repo;
 }
Ejemplo n.º 10
0
 public AssignResourcesCommandHandler(IJobTaskRepository repo)
 {
     _repo = repo;
 }
Ejemplo n.º 11
0
 public TaskAssignedValidator(IJobTaskRepository jobTaskRepository)
 {
     this.jobTaskRepository = jobTaskRepository;
 }
Ejemplo n.º 12
0
 public DeleteJobTaskCommandHandler(IJobTaskRepository repo)
 {
     _repo = repo;
 }
Ejemplo n.º 13
0
 public RemoveWorkersCommandHandler(IJobTaskRepository repo)
 {
     _repo = repo;
 }
Ejemplo n.º 14
0
 public EditJobTaskCommandHandler(IJobTaskRepository repo)
 {
     _repo = repo;
 }
Ejemplo n.º 15
0
 public GetJobTasksListQueryHandler(IJobTaskRepository repo)
 {
     _repo = repo;
 }