Package com.inductiveautomation.sfc.api
Class ExecutionQueue
- java.lang.Object
-
- com.inductiveautomation.sfc.api.ExecutionQueue
-
public class ExecutionQueue extends java.lang.ObjectQueues up submittedRunnables and executes them in serial on anExecutorService.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classExecutionQueue.ThrowableCatchingRunnable
-
Constructor Summary
Constructors Constructor Description ExecutionQueue(java.util.concurrent.ExecutorService service, MDCUtils.MDCDetails logDetails)ExecutionQueue(java.util.concurrent.ExecutorService service, MDCUtils.MDCDetails logDetails, java.lang.String identId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginTransaction()If multiple commands must be put on the queue in an atomic manner, use this to begin a transaction.voidcloseTransaction()voidpause()Pause execution of queuedRunnables.voidresume()Resume execution of queuedRunnables.voidsubmit(java.lang.Runnable runnable)Submit aRunnableto be executed.voidsubmit(java.lang.Runnable runnable, java.lang.String logMsg)
-
-
-
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 aRunnableto be executed.- Parameters:
runnable- theRunnableto be executed.
-
submit
public void submit(java.lang.Runnable runnable, java.lang.String logMsg)
-
pause
public void pause()
Pause execution of queuedRunnables.
-
resume
public void resume()
Resume execution of queuedRunnables.
-
-