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 Constructor Description TaskRunningServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
void
bindTo(io.micrometer.core.instrument.MeterRegistry meterRegistry)
void
destroy()
SubmittedTask
getSubmittedTask(String taskId)
Collection<SubmittedTask>
getSubmittedTasks()
<T extends Task<?>>
StringsubmitTask(T task)
<C extends TaskCommand>
StringsubmitTaskCommand(C taskCommand)
We check if there are listeners on task submission queue to decide if remote tasks can be served.
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
Exception
-
destroy
public void destroy() throws Exception
- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Throws:
Exception
-
getSubmittedTask
public SubmittedTask getSubmittedTask(String taskId)
- Specified by:
getSubmittedTask
in interfaceTaskRunningService
-
getSubmittedTasks
public Collection<SubmittedTask> getSubmittedTasks()
- Specified by:
getSubmittedTasks
in interfaceTaskRunningService
- Returns:
- the submittedTasks
-
submitTask
public <T extends Task<?>> String submitTask(T task)
- Specified by:
submitTask
in interfaceTaskRunningService
-
submitTaskCommand
public <C extends TaskCommand> String submitTaskCommand(C taskCommand)
We check if there are listeners on task submission queue to decide if remote tasks can be served.- 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
-
-