Class ExecutionQueue


  • public class ExecutionQueue
    extends java.lang.Object
    Queues up submitted Runnables and executes them in serial on an ExecutorService.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void beginTransaction()
      If multiple commands must be put on the queue in an atomic manner, use this to begin a transaction.
      void closeTransaction()  
      void pause()
      Pause execution of queued Runnables.
      void resume()
      Resume execution of queued Runnables.
      void submit​(java.lang.Runnable runnable)
      Submit a Runnable to be executed.
      void submit​(java.lang.Runnable runnable, java.lang.String logMsg)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExecutionQueue

        public ExecutionQueue​(java.util.concurrent.ExecutorService service,
                              MDCUtils.MDCDetails logDetails)
      • ExecutionQueue

        public ExecutionQueue​(java.util.concurrent.ExecutorService service,
                              MDCUtils.MDCDetails logDetails,
                              java.lang.String identId)
    • Method Detail

      • beginTransaction

        public void beginTransaction()
        If multiple commands must be put on the queue in an atomic manner, use this to begin a transaction. All submissions will be queued in order with nothing else allowed until closeTransaction is called. Be sure to call closeTransaction in a finally block.
      • closeTransaction

        public void closeTransaction()
      • submit

        public void submit​(java.lang.Runnable runnable)
        Submit a Runnable to be executed.
        Parameters:
        runnable - the Runnable to be executed.
      • submit

        public void submit​(java.lang.Runnable runnable,
                           java.lang.String logMsg)
      • pause

        public void pause()
        Pause execution of queued Runnables.
      • resume

        public void resume()
        Resume execution of queued Runnables.