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.



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 applied
    void run()  
    long sleepTime()
    Retrieve the Sleep Time
    java.util.List<java.lang.Runnable> taskList()
    Retrieve the Underlying Runnable Task List

    Methods 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.Exception
      InterruptibleDaemon Constructor
      Parameters:
      taskList - Underlying Runnable Task List
      sleepTime - Sleep Time
      checkForInterruption - 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 interface java.lang.Runnable