Package io.atomix.utils.concurrent
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 Summary
Constructors Constructor Description NullThreadContext()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidblock()Marks the thread context as blocked.voidclose()Closes the context.voidexecute(Runnable command)booleanisBlocked()Returns whether the thread context is currently marked blocked.Scheduledschedule(Duration delay, Runnable callback)Schedules a runnable after a delay.Scheduledschedule(Duration initialDelay, Duration interval, Runnable callback)Schedules a runnable at a fixed rate.voidunblock()Marks the thread context as unblocked.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.atomix.utils.concurrent.ThreadContext
checkThread, isCurrentContext
-
-
-
-
Method Detail
-
schedule
public Scheduled schedule(Duration delay, Runnable callback)
Description copied from interface:SchedulerSchedules a runnable after a delay.
-
schedule
public Scheduled schedule(Duration initialDelay, Duration interval, Runnable callback)
Description copied from interface:SchedulerSchedules a runnable at a fixed rate.
-
isBlocked
public boolean isBlocked()
Description copied from interface:ThreadContextReturns whether the thread context is currently marked blocked.- Specified by:
isBlockedin interfaceThreadContext- Returns:
- whether the thread context is currently marked blocked
-
block
public void block()
Description copied from interface:ThreadContextMarks the thread context as blocked.- Specified by:
blockin interfaceThreadContext
-
unblock
public void unblock()
Description copied from interface:ThreadContextMarks the thread context as unblocked.- Specified by:
unblockin interfaceThreadContext
-
close
public void close()
Description copied from interface:ThreadContextCloses the context.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceThreadContext
-
-