Package org.drip.graph.concurrency
Class InterruptibleDaemon
java.lang.Object
org.drip.graph.concurrency.InterruptibleDaemon
- All Implemented Interfaces:
java.lang.Runnable
public class InterruptibleDaemon
extends java.lang.Object
implements java.lang.Runnable
InterruptibleDaemon implements a Runnable Task that can be Interrupted Gracefully.
- Module = Computational Core Module
- Library = Graph Algorithm Library
- Project = Graph Optimization and Tree Construction Algorithms
- Package = Helper Classes For Concurrent Tasks
- Author:
- Lakshmi Krishnamurthy
-
Constructor Summary
Constructors Constructor Description InterruptibleDaemon(java.util.List<java.lang.Runnable> taskList, long sleepTime, boolean checkForInterruption)
InterruptibleDaemon Constructor -
Method Summary
Modifier and Type Method Description boolean
checkForInterruption()
Indicate if the Interruption Check can be appliedvoid
run()
long
sleepTime()
Retrieve the Sleep Timejava.util.List<java.lang.Runnable>
taskList()
Retrieve the Underlying Runnable Task ListMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
InterruptibleDaemon
public InterruptibleDaemon(java.util.List<java.lang.Runnable> taskList, long sleepTime, boolean checkForInterruption) throws java.lang.ExceptionInterruptibleDaemon Constructor- Parameters:
taskList
- Underlying Runnable Task ListsleepTime
- Sleep TimecheckForInterruption
- TRUE - Interruption Check can be applied- Throws:
java.lang.Exception
- Thrown if the Inputs are Invalid
-
-
Method Details
-
taskList
public java.util.List<java.lang.Runnable> taskList()Retrieve the Underlying Runnable Task List- Returns:
- The Underlying Runnable Task List
-
sleepTime
public long sleepTime()Retrieve the Sleep Time- Returns:
- The Sleep Time
-
checkForInterruption
public boolean checkForInterruption()Indicate if the Interruption Check can be applied- Returns:
- TRUE - Interruption Check can be applied
-
run
public void run()- Specified by:
run
in interfacejava.lang.Runnable
-