Class 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 Detail

      • TaskRunningServiceImpl

        public TaskRunningServiceImpl()
    • Method Detail

      • 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
      • submitTaskCommand

        public <C extends TaskCommandString 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 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