Class BlockingWork
java.lang.Object
com.inductiveautomation.perspective.gateway.threading.BlockingWork
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic void
begin()
Assertion checks to see if the current thread allows blocking work.static <E extends Throwable>
voidinvokeBlockingTask
(FragileRunnable<E> runnable) Invokes a task that is expected to perform blocking work.static void
setBlockingWorkAllowed
(boolean allowed) static ThreadFactory
wrapThreadFactory
(ThreadFactory delegate) Wraps a thread factory to allow blocking work.
-
Method Details
-
begin
public static void begin()Assertion checks to see if the current thread allows blocking work. Throws if not allowed.- Throws:
BlockingWork.NoBlockingWorkAllowedException
- if blocking work not allowed on calling thread.
-
setBlockingWorkAllowed
public static void setBlockingWorkAllowed(boolean allowed) -
invokeBlockingTask
Invokes a task that is expected to perform blocking work. Leaves the state of the thread's blocking work policy unchanged.- Throws:
E extends Throwable
-
wrapThreadFactory
Wraps a thread factory to allow blocking work.
-