Package com.inductiveautomation.sfc.api
Class ExecutionQueue
- java.lang.Object
-
- com.inductiveautomation.sfc.api.ExecutionQueue
-
public class ExecutionQueue extends java.lang.Object
Queues up submittedRunnable
s and executes them in serial on anExecutorService
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ExecutionQueue.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 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 queuedRunnable
s.void
resume()
Resume execution of queuedRunnable
s.void
submit(java.lang.Runnable runnable)
Submit aRunnable
to be executed.void
submit(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 aRunnable
to be executed.- Parameters:
runnable
- theRunnable
to be executed.
-
submit
public void submit(java.lang.Runnable runnable, java.lang.String logMsg)
-
pause
public void pause()
Pause execution of queuedRunnable
s.
-
resume
public void resume()
Resume execution of queuedRunnable
s.
-
-