Clover icon

sunshower-core

  1. Project Clover database Fri Apr 6 2018 03:27:42 UTC
  2. Package io.sunshower.service.task.exec

File DefaultTaskService.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart4.png
46% of files have more coverage

Code metrics

0
7
3
1
37
30
3
0.43
2.33
3
1

Classes

Class Line # Actions
DefaultTaskService 13 7 3
0.440%
 

Contributing tests

This file is covered by 2 tests. .

Source view

1    package io.sunshower.service.task.exec;
2   
3    import io.sunshower.common.Identifier;
4    import io.sunshower.service.graph.service.GraphService;
5    import io.sunshower.service.graph.service.TaskService;
6    import io.sunshower.service.hal.core.Graph;
7    import io.sunshower.service.model.task.ExecutionMonitor;
8    import io.sunshower.service.task.TaskContext;
9    import io.sunshower.service.task.TaskGraph;
10    import io.sunshower.service.task.Tasks;
11    import javax.inject.Inject;
12   
 
13    public class DefaultTaskService implements TaskService {
14   
15    @Inject private GraphTransformer transformer;
16   
17    @Inject private ParallelTaskExecutor executor;
18   
 
19  2 toggle @Override
20    public ExecutionMonitor plan(Identifier tid, GraphService service) {
21  2 final Graph graph = service.getCurrentGraph(tid);
22  2 final TaskGraph taskGraph = transformer.transform(graph);
23  2 return executor.createPlan(taskGraph);
24    }
25   
 
26  0 toggle @Override
27    public ExecutionMonitor execute(Identifier tid, GraphService service) {
28  0 return execute(tid, service, Tasks.context());
29    }
30   
 
31  0 toggle @Override
32    public ExecutionMonitor execute(Identifier tid, GraphService service, TaskContext context) {
33  0 final Graph graph = service.getCurrentGraph(tid);
34  0 final TaskGraph taskGraph = transformer.transform(graph);
35  0 return executor.run(taskGraph, context);
36    }
37    }