Class Netty4IOContext.NettyIOScheduler

java.lang.Object
org.apache.qpid.protonj2.client.transport.netty4.Netty4IOContext.NettyIOScheduler
All Implemented Interfaces:
Executor, Scheduler
Enclosing class:
Netty4IOContext

public class Netty4IOContext.NettyIOScheduler extends Object implements Scheduler, Executor
  • Constructor Details

    • NettyIOScheduler

      public NettyIOScheduler()
  • Method Details

    • execute

      public void execute(Runnable command)
      Description copied from interface: Scheduler
      Runs the given Runnable command at some point in the future on a the same thread of execution as all other API interactions with the proton Engine. The execution can be queued or it could be run immediately so long as the execution occurs on the thread that has exclusive access to the engine.
      Specified by:
      execute in interface Executor
      Specified by:
      execute in interface Scheduler
      Parameters:
      command - the Runnable instance to execute.
    • schedule

      public Future<?> schedule(Runnable command, long delay, TimeUnit unit)
      Description copied from interface: Scheduler
      Schedule the given Runnable for execution after the given delay.
      Specified by:
      schedule in interface Scheduler
      Parameters:
      command - The runnable action to schedule
      delay - The time value to wait before running the command.
      unit - The time unit that define the units of the delay value.
      Returns:
      a Future instance that can be awaited for completion of the task.
    • schedule

      public <V> Future<V> schedule(Callable<V> task, long delay, TimeUnit unit)
      Description copied from interface: Scheduler
      Schedule the given task for execution after the given delay.
      Specified by:
      schedule in interface Scheduler
      Type Parameters:
      V - The return type of the task
      Parameters:
      task - The callable action action to schedule
      delay - The time value to wait before running the command.
      unit - The time unit that define the units of the delay value.
      Returns:
      a Future instance that can be awaited for completion of the task.
    • scheduleAtFixedRate

      public Future<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
      Description copied from interface: Scheduler
      Schedule the given task for execution after the given delay to repeat with the given period.
      Specified by:
      scheduleAtFixedRate in interface Scheduler
      Parameters:
      command - The runnable command to execute at the specified rate.
      initialDelay - The initial delay before running the given command.
      period - The time period in which to execute the given command
      unit - The units of the specified time period
      Returns:
      a Future instance that can be awaited for completion of the task.
    • scheduleWithFixedDelay

      public Future<?> scheduleWithFixedDelay(Runnable command, long initialDelay, long delay, TimeUnit unit)
      Description copied from interface: Scheduler
      Schedule the given task for execution after the given delay to repeat with the given period.
      Specified by:
      scheduleWithFixedDelay in interface Scheduler
      Parameters:
      command - The runnable command to execute at the specified rate.
      initialDelay - The initial delay before running the given command.
      delay - The delay time between runs of the given command.
      unit - The units of the specified time period
      Returns:
      a Future instance that can be awaited for completion of the task.
    • isShutdown

      public boolean isShutdown()
      Specified by:
      isShutdown in interface Scheduler
      Returns:
      if the Scheduler has been shutdown or not.