Interface JobRunner<T extends Job>

    • Method Detail

      • addJobCompleteListener

        void addJobCompleteListener​(JobCompleteListener l)
        Adds the listener.
        Parameters:
        l - the listener to add
      • removeJobCompleteListener

        void removeJobCompleteListener​(JobCompleteListener l)
        Removes the listener.
        Parameters:
        l - the listener to remove
      • clear

        void clear()
        Clears all jobs.
      • add

        void add​(T job)
        Adds the job to the execution queue.
        Parameters:
        job - the job to add
      • add

        void add​(JobList<T> jobs)
        Adds the jobs to the execution queue.
        Parameters:
        jobs - the jobs to add
      • getJobs

        List<T> getJobs()
        Returns the list of queued jobs.
        Returns:
        the jobs
      • start

        void start()
        Starts the execution of jobs.
      • stop

        void stop()
        Stops the execution after all currently queued jobs have been executed.
      • terminate

        void terminate()
        Stops the execution immediately. Waits for the jobs to finish.
      • terminate

        void terminate​(boolean wait)
        Stops the execution immediately.
        Parameters:
        wait - whether to wait for the jobs to finish
      • complete

        void complete​(T j,
                      JobResult jr)
        Job is complete, so check for more to add..
        Parameters:
        j - job
        jr - job result
      • isRunning

        boolean isRunning()
        Returns whether the job are being executed.
        Returns:
        true if jobs are being executed
      • pauseExecution

        void pauseExecution()
        Pauses the execution.
        Specified by:
        pauseExecution in interface Pausable
      • isPaused

        boolean isPaused()
        Returns whether the object is currently paused.
        Specified by:
        isPaused in interface Pausable
        Returns:
        true if object is paused
      • resumeExecution

        void resumeExecution()
        Resumes the execution.
        Specified by:
        resumeExecution in interface Pausable
      • setFlowContext

        void setFlowContext​(Actor value)
        Sets the flow context, if any.
        Parameters:
        value - the context
      • getFlowContext

        Actor getFlowContext()
        Return the flow context, if any.
        Returns:
        the context, null if none available