Class AbstractTaskScheduler

    • Constructor Detail

      • AbstractTaskScheduler

        protected AbstractTaskScheduler()
        Protected constructor.
    • Method Detail

      • getStep

        protected Step getStep​(TaskContextImpl context)
        Get the step related to a context.
        Parameters:
        context - the context
        Returns:
        the step related to the context
      • getStep

        protected Step getStep​(int contextId)
        Get the step related to a context.
        Parameters:
        contextId - the context id
        Returns:
        the step related to the context
      • beforeExecuteTask

        protected void beforeExecuteTask​(TaskContextImpl context)
        Set the state of the context before executing a task.
        Parameters:
        context - the context to execute
      • afterExecuteTask

        protected void afterExecuteTask​(TaskContextImpl context,
                                        TaskResultImpl result)
        Set the state of the context after executing a task.
        Parameters:
        context - the context to execute
      • executeTask

        protected TaskResultImpl executeTask​(TaskContextImpl context)
        Default executing context method.
        Parameters:
        context - the context
        Returns:
        a TaskResult object
      • submit

        public void submit​(Step step,
                           Set<TaskContextImpl> contexts)
        Description copied from interface: TaskScheduler
        Submit contexts to execute.
        Specified by:
        submit in interface TaskScheduler
        Parameters:
        step - step related to the contexts
        contexts - contexts to execute
      • submit

        public void submit​(Step step,
                           TaskContextImpl context)
        Description copied from interface: TaskScheduler
        Submit a context to execute.
        Specified by:
        submit in interface TaskScheduler
        Parameters:
        step - step related to the context
        context - context to execute
      • getStatus

        public StepStatus getStatus​(Step step)
        Description copied from interface: TaskScheduler
        Get the status related to a step.
        Specified by:
        getStatus in interface TaskScheduler
        Parameters:
        step - a workflow step
        Returns:
        the step status object related to the step
      • getResult

        public StepResult getResult​(Step step)
        Description copied from interface: TaskScheduler
        Get the result related to a step.
        Specified by:
        getResult in interface TaskScheduler
        Parameters:
        step - a workflow step
        Returns:
        the step result object related to the step
      • getTaskSubmittedCount

        public int getTaskSubmittedCount​(Step step)
        Description copied from interface: TaskScheduler
        Get the count of submitted task contexts of a step.
        Specified by:
        getTaskSubmittedCount in interface TaskScheduler
        Parameters:
        step - a workflow step
        Returns:
        the count of submitted task contexts
      • getTaskRunningCount

        public int getTaskRunningCount​(Step step)
        Description copied from interface: TaskScheduler
        Get the count of running task contexts of a step.
        Specified by:
        getTaskRunningCount in interface TaskScheduler
        Parameters:
        step - a workflow step
        Returns:
        the count of running task contexts
      • getTaskDoneCount

        public int getTaskDoneCount​(Step step)
        Description copied from interface: TaskScheduler
        Get the count of done task contexts of a step.
        Specified by:
        getTaskDoneCount in interface TaskScheduler
        Parameters:
        step - a workflow step
        Returns:
        the count of done task contexts
      • getTotalTaskSubmittedCount

        public int getTotalTaskSubmittedCount()
        Description copied from interface: TaskScheduler
        Get the count of submitted task contexts for the workflow.
        Specified by:
        getTotalTaskSubmittedCount in interface TaskScheduler
        Returns:
        the count of submitted task contexts
      • getTotalTaskRunningCount

        public int getTotalTaskRunningCount()
        Description copied from interface: TaskScheduler
        Get the count of running task contexts for the workflow.
        Specified by:
        getTotalTaskRunningCount in interface TaskScheduler
        Returns:
        the count of running task contexts
      • getTotalTaskDoneCount

        public int getTotalTaskDoneCount()
        Description copied from interface: TaskScheduler
        Get the count of done task contexts for the workflow.
        Specified by:
        getTotalTaskDoneCount in interface TaskScheduler
        Returns:
        the count of done task contexts
      • waitEndOfTasks

        public void waitEndOfTasks​(Step step)
        Description copied from interface: TaskScheduler
        Wait the end of the task contexts.
        Specified by:
        waitEndOfTasks in interface TaskScheduler
        Parameters:
        step - a workflow step
      • isStarted

        protected boolean isStarted()
      • isStopped

        protected boolean isStopped()