Class BlockingWork
- java.lang.Object
-
- com.inductiveautomation.perspective.gateway.threading.BlockingWork
-
public class BlockingWork extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BlockingWork.NoBlockingWorkAllowedException
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
begin()
Assertion checks to see if the current thread allows blocking work.static <E extends java.lang.Throwable>
voidinvokeBlockingTask(FragileRunnable<E> runnable)
Invokes a task that is expected to perform blocking work.static void
setBlockingWorkAllowed(boolean allowed)
static java.util.concurrent.ThreadFactory
wrapThreadFactory(java.util.concurrent.ThreadFactory delegate)
Wraps a thread factory to allow blocking work.
-
-
-
Method Detail
-
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
public static <E extends java.lang.Throwable> void invokeBlockingTask(FragileRunnable<E> runnable) throws E extends java.lang.Throwable
Invokes a task that is expected to perform blocking work. Leaves the state of the thread's blocking work policy unchanged.- Throws:
E extends java.lang.Throwable
-
wrapThreadFactory
public static java.util.concurrent.ThreadFactory wrapThreadFactory(java.util.concurrent.ThreadFactory delegate)
Wraps a thread factory to allow blocking work.
-
-