1
2
3
4
5
6 package com.hack23.cia.service.impl.admin;
7
8 import org.springframework.core.task.TaskExecutor;
9
10 /***
11 * The Class TaskServiceImpl.
12 */
13 public class TaskServiceImpl implements TaskService {
14
15 /*** The task execution. */
16 private final Runnable taskExecution;
17
18 /*** The task executor. */
19 private final TaskExecutor taskExecutor;
20
21 /***
22 * Instantiates a new task service impl.
23 *
24 * @param taskExecutor the task executor
25 * @param taskExecution the task execution
26 */
27 public TaskServiceImpl(final TaskExecutor taskExecutor,
28 final Runnable taskExecution) {
29 super();
30 this.taskExecutor = taskExecutor;
31 this.taskExecution = taskExecution;
32 }
33
34
35
36
37
38
39 @Override
40 public final void execute() {
41 taskExecutor.execute(taskExecution);
42 }
43
44 }