public class CycleProtector
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
CycleProtector.CycleDetectedException
Exception thrown when a cycle was detected
|
static class |
CycleProtector.PendingCycleProtectionException
Exception thrown when a protection stack was not cleanly resolved
at the end of a work unit.
|
Constructor and Description |
---|
CycleProtector() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
call(java.lang.String node,
java.util.concurrent.Callable<T> call)
Call a control flow as
Callable |
static void |
clear()
Forcibly clear the protector.
|
static int |
depth()
Returns depth of current traversal.
|
static void |
enter(java.lang.String node)
Enter a control flow that is not to be traversed again deeper.
|
static void |
leave(java.lang.String node)
Leave a control flow again.
|
static void |
run(java.lang.String node,
java.lang.Runnable run)
Run a control flow
|
protected static java.lang.String |
stateToString() |
static <T> T |
supply(java.lang.String node,
java.util.function.Supplier<T> supplier)
Call a control flow as Supplier
|
public static void enter(java.lang.String node) throws CycleProtector.CycleDetectedException
public static void clear()
public static void leave(java.lang.String node) throws CycleProtector.CycleDetectedException
public static void run(java.lang.String node, java.lang.Runnable run)
public static <T> T call(java.lang.String node, java.util.concurrent.Callable<T> call) throws java.lang.Exception
Callable
java.lang.Exception
public static <T> T supply(java.lang.String node, java.util.function.Supplier<T> supplier)
protected static java.lang.String stateToString()
public static int depth()