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 Details

    • TaskRunningServiceImpl

      public TaskRunningServiceImpl()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • destroy

      public void destroy() throws Exception
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
      Throws:
      Exception
    • getSubmittedTask

      public SubmittedTask getSubmittedTask(String taskId)
      Specified by:
      getSubmittedTask in interface TaskRunningService
    • getSubmittedTasks

      public Collection<SubmittedTask> getSubmittedTasks()
      Specified by:
      getSubmittedTasks in interface TaskRunningService
      Returns:
      the submittedTasks
    • submitTask

      public <T extends Task<?>> String submitTask(T task)
      Specified by:
      submitTask in interface TaskRunningService
    • submitTaskCommand

      public <C extends TaskCommand> String submitTaskCommand(C taskCommand)
      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 interface TaskRunningService
      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 interface io.micrometer.core.instrument.binder.MeterBinder