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 TypeMethodDescriptionvoidvoidbindTo(io.micrometer.core.instrument.MeterRegistry meterRegistry) voiddestroy()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:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
destroy
- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
Exception
-
getSubmittedTask
- Specified by:
getSubmittedTaskin interfaceTaskRunningService
-
getSubmittedTasks
- Specified by:
getSubmittedTasksin interfaceTaskRunningService- Returns:
- the submittedTasks
-
submitTask
- Specified by:
submitTaskin interfaceTaskRunningService
-
submitTaskCommand
Description copied from interface:TaskRunningServiceSubmit 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:
submitTaskCommandin 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:
bindToin interfaceio.micrometer.core.instrument.binder.MeterBinder
-