Package ubic.gemma.core.job
Class TaskRunningServiceImpl
java.lang.Object
ubic.gemma.core.job.TaskRunningServiceImpl
- All Implemented Interfaces:
io.micrometer.core.instrument.binder.MeterBinder
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,TaskRunningService
@Component("taskRunningService")
@ParametersAreNonnullByDefault
public class TaskRunningServiceImpl
extends Object
implements TaskRunningService, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Handles the execution of tasks in threads that can be checked by clients later.
- Author:
- pavlidis
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
bindTo
(io.micrometer.core.instrument.MeterRegistry meterRegistry) void
destroy()
getSubmittedTask
(String taskId) submitTask
(T task) <C extends TaskCommand>
StringsubmitTaskCommand
(C taskCommand) Submit a task and track its progress.
-
Constructor Details
-
TaskRunningServiceImpl
public TaskRunningServiceImpl()
-
-
Method Details
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
destroy
- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Throws:
Exception
-
getSubmittedTask
- Specified by:
getSubmittedTask
in interfaceTaskRunningService
-
getSubmittedTasks
- Specified by:
getSubmittedTasks
in interfaceTaskRunningService
- Returns:
- the submittedTasks
-
submitTask
- Specified by:
submitTask
in interfaceTaskRunningService
-
submitTaskCommand
Description copied from interface:TaskRunningService
Submit a task and track its progress. When it is finished, the results can be retrieved with checkResult(). Tasks can be cancelled with cancelTask().- Specified by:
submitTaskCommand
in interfaceTaskRunningService
- Type Parameters:
C
- task command implementation- Parameters:
taskCommand
- The command to run. The submissionTime of the task is set after this call. This does not mean that the job has started - it might be queued.- Returns:
- string
-
bindTo
public void bindTo(io.micrometer.core.instrument.MeterRegistry meterRegistry) - Specified by:
bindTo
in interfaceio.micrometer.core.instrument.binder.MeterBinder
-