Package org.apache.cassandra.concurrent
Class InfiniteLoopExecutor
- java.lang.Object
-
- org.apache.cassandra.concurrent.InfiniteLoopExecutor
-
- All Implemented Interfaces:
Interruptible,Shutdownable
public class InfiniteLoopExecutor extends java.lang.Object implements Interruptible
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInfiniteLoopExecutor.Daemonstatic classInfiniteLoopExecutor.InternalStatestatic classInfiniteLoopExecutor.Interruptsstatic classInfiniteLoopExecutor.SimulatorSafe-
Nested classes/interfaces inherited from interface org.apache.cassandra.concurrent.Interruptible
Interruptible.SimpleTask, Interruptible.State, Interruptible.Task, Interruptible.TerminateException
-
-
Constructor Summary
Constructors Constructor Description InfiniteLoopExecutor(java.lang.String name, Interruptible.Task task, InfiniteLoopExecutor.Daemon daemon)InfiniteLoopExecutor(java.util.function.BiFunction<java.lang.String,java.lang.Runnable,java.lang.Thread> threadStarter, java.lang.String name, Interruptible.Task task, InfiniteLoopExecutor.Interrupts interrupts)InfiniteLoopExecutor(ExecutorFactory factory, java.lang.String name, Interruptible.Task task, InfiniteLoopExecutor.Daemon daemon)InfiniteLoopExecutor(ExecutorFactory factory, java.lang.String name, Interruptible.Task task, InfiniteLoopExecutor.Daemon daemon, InfiniteLoopExecutor.Interrupts interrupts)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanawaitTermination(long time, java.util.concurrent.TimeUnit unit)Await termination of this object, i.e.voidinterrupt()booleanisAlive()booleanisTerminated()voidshutdown()Shutdown once any remaining work has completed (however this is defined for the implementation).java.lang.ObjectshutdownNow()Shutdown immediately, possibly interrupting ongoing work, and cancelling work that is queued.
-
-
-
Constructor Detail
-
InfiniteLoopExecutor
public InfiniteLoopExecutor(java.lang.String name, Interruptible.Task task, InfiniteLoopExecutor.Daemon daemon)
-
InfiniteLoopExecutor
public InfiniteLoopExecutor(ExecutorFactory factory, java.lang.String name, Interruptible.Task task, InfiniteLoopExecutor.Daemon daemon)
-
InfiniteLoopExecutor
public InfiniteLoopExecutor(ExecutorFactory factory, java.lang.String name, Interruptible.Task task, InfiniteLoopExecutor.Daemon daemon, InfiniteLoopExecutor.Interrupts interrupts)
-
InfiniteLoopExecutor
public InfiniteLoopExecutor(java.util.function.BiFunction<java.lang.String,java.lang.Runnable,java.lang.Thread> threadStarter, java.lang.String name, Interruptible.Task task, InfiniteLoopExecutor.Interrupts interrupts)
-
-
Method Detail
-
interrupt
public void interrupt()
- Specified by:
interruptin interfaceInterruptible
-
shutdown
public void shutdown()
Description copied from interface:ShutdownableShutdown once any remaining work has completed (however this is defined for the implementation).- Specified by:
shutdownin interfaceShutdownable
-
shutdownNow
public java.lang.Object shutdownNow()
Description copied from interface:ShutdownableShutdown immediately, possibly interrupting ongoing work, and cancelling work that is queued.- Specified by:
shutdownNowin interfaceShutdownable
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminatedin interfaceShutdownable
-
awaitTermination
public boolean awaitTermination(long time, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedExceptionDescription copied from interface:ShutdownableAwait termination of this object, i.e. the cessation of all current and future work.- Specified by:
awaitTerminationin interfaceShutdownable- Throws:
java.lang.InterruptedException
-
isAlive
public boolean isAlive()
-
-