Class SimpleSchedulerContext

java.lang.Object
dev.getelements.elements.rt.SimpleSchedulerContext
All Implemented Interfaces:
SchedulerContext

public class SimpleSchedulerContext extends Object implements SchedulerContext
  • Constructor Details

    • SimpleSchedulerContext

      public SimpleSchedulerContext()
  • Method Details

    • start

      public void start()
      Description copied from interface: SchedulerContext
      Starts this SchedulerContext.
      Specified by:
      start in interface SchedulerContext
    • stop

      public void stop()
      Description copied from interface: SchedulerContext
      Stops this SchedulerContext.
      Specified by:
      stop in interface SchedulerContext
    • resume

      public void resume(TaskId taskId, Object... results)
      Description copied from interface: SchedulerContext
      Resumes the supplied task with the TaskId supplying multiple results to the destination.
      Specified by:
      resume in interface SchedulerContext
      Parameters:
      taskId - the TaskId of the supplied task
      results - zero or more results from resuming the task
    • resumeTaskAfterDelay

      public void resumeTaskAfterDelay(TaskId taskId, long time, TimeUnit timeUnit)
      Description copied from interface: SchedulerContext
      Resumes the task associated with the supplied TaskId. This allows for the specification of a delay after a specified period of time.
      Specified by:
      resumeTaskAfterDelay in interface SchedulerContext
      Parameters:
      taskId - the TaskId of the task
      time - the time delay
      timeUnit - the TimeUnit instance designating the time units of measure
    • resumeTaskAfterDelay

      public void resumeTaskAfterDelay(long time, TimeUnit timeUnit, TaskId taskId, Runnable resumed)
    • resumeFromNetwork

      public void resumeFromNetwork(TaskId taskId, Object result)
      Description copied from interface: SchedulerContext
      Resumes a task that was waiting on a network call.
      Specified by:
      resumeFromNetwork in interface SchedulerContext
      Parameters:
      taskId - the unique TaskId associated with the network
      result - the result of the network operation, passed to the task
    • resumeWithError

      public void resumeWithError(TaskId taskId, Throwable throwable)
      Description copied from interface: SchedulerContext
      Resumes a task that was waiting for any reason. This is used to hand an error to the running task in order to a task waiting on an operation.
      Specified by:
      resumeWithError in interface SchedulerContext
      Parameters:
      taskId - the unique TaskId associated with the network
      throwable - the error in the blocked operation
    • getScheduler

      public Scheduler getScheduler()
    • setScheduler

      @Inject public void setScheduler(Scheduler scheduler)
    • getTaskService

      public TaskService getTaskService()
    • setTaskService

      @Inject public void setTaskService(TaskService taskService)