Class NullThreadContext

java.lang.Object
io.atomix.utils.concurrent.NullThreadContext
All Implemented Interfaces:
Scheduler, ThreadContext, AutoCloseable, Executor

public class NullThreadContext extends Object implements ThreadContext
Null thread context.
  • Constructor Details

    • NullThreadContext

      public NullThreadContext()
  • Method Details

    • schedule

      public Scheduled schedule(Duration delay, Runnable callback)
      Description copied from interface: Scheduler
      Schedules a runnable after a delay.
      Specified by:
      schedule in interface Scheduler
      Parameters:
      delay - the delay after which to run the callback
      callback - the callback to run
      Returns:
      the scheduled callback
    • schedule

      public Scheduled schedule(Duration initialDelay, Duration interval, Runnable callback)
      Description copied from interface: Scheduler
      Schedules a runnable at a fixed rate.
      Specified by:
      schedule in interface Scheduler
      Parameters:
      initialDelay - the initial delay
      interval - the interval at which to run the callback
      callback - the callback to run
      Returns:
      the scheduled callback
    • isBlocked

      public boolean isBlocked()
      Description copied from interface: ThreadContext
      Returns whether the thread context is currently marked blocked.
      Specified by:
      isBlocked in interface ThreadContext
      Returns:
      whether the thread context is currently marked blocked
    • block

      public void block()
      Description copied from interface: ThreadContext
      Marks the thread context as blocked.
      Specified by:
      block in interface ThreadContext
    • unblock

      public void unblock()
      Description copied from interface: ThreadContext
      Marks the thread context as unblocked.
      Specified by:
      unblock in interface ThreadContext
    • close

      public void close()
      Description copied from interface: ThreadContext
      Closes the context.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface ThreadContext
    • execute

      public void execute(Runnable command)
      Specified by:
      execute in interface Executor