A task (typically either a Runnable or Callable
that declares how it will behave when invoked:
Static methods and are provided that allow the current thread to be tagged
with a ThreadLocal to indicate if it has a blocking invocation type.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | |
| public static enum | Invocable.InvocationType
The behavior of an |
| public static class | Invocable.ReadyTask
A |
| public static interface | Invocable.Task
A task with an |
| Modifier and Type | Field and Description |
|---|---|
| public static final ThreadLocal | |
| public static final Runnable |
| Modifier and Type | Method and Description |
|---|---|
| public static Invocable. | Returns: The combination of both type, where any tendency to block overrules any non blocking.A type it1,Another type it2Combine two invocation type. |
| public static Runnable | |
| public static Invocable. | Returns: a new Taskthe InvocationType type,the Runnable task)Creates a |
| public static Invocable. | Returns: If the object is an Invocable, it is coerced and thegetInvocationType()
used, otherwise InvocationType#BLOCKING is returned.The object to check the invocation type of. o)Get the invocation type of an Object. |
| public default Invocable. | |
| public static void | invokeNonBlocking(Runnable
The task to invoke. task)Invoke a task with the calling thread, tagged to indicate that it will not block. |
| public static boolean | Returns: True if the task the current thread is running has indicated that it will not block.Test if the current thread has been tagged as non blocking |
| __nonBlocking | back to summary |
|---|---|
| public static final ThreadLocal<Boolean> __nonBlocking | |
| NOOP | back to summary |
|---|---|
| public static final Runnable NOOP | |
| combine | back to summary |
|---|---|
| public static Invocable. Combine two invocation type.
| |
| combine | back to summary |
|---|---|
| public static Runnable combine(Runnable... runnables) Combine
| |
| from | back to summary |
|---|---|
| public static Invocable. Creates a
| |
| getInvocationType | back to summary |
|---|---|
| public static Invocable. Get the invocation type of an Object.
| |
| getInvocationType | back to summary |
|---|---|
public default Invocable.
| |
| invokeNonBlocking | back to summary |
|---|---|
| public static void invokeNonBlocking(Runnable task) Invoke a task with the calling thread, tagged to indicate that it will not block.
| |
| isNonBlockingInvocation | back to summary |
|---|---|
| public static boolean isNonBlockingInvocation() Test if the current thread has been tagged as non blocking
| |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| call | back to summary |
|---|---|
| public void call() throws Exception | |
The behavior of an Invocable when it is invoked.
Typically, Runnables or org.s declare their
invocation type; this information is then used by the code that should
invoke the Runnable or Callback to decide whether to
invoke it directly, or submit it to a thread pool to be invoked by
a different thread.
| Modifier and Type | Field and Description |
|---|---|
| public static final Invocable. | |
| public static final Invocable. | |
| public static final Invocable. | NON_BLOCKING
Invoking the |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Invocable. | |
| public static Invocable. |
| BLOCKING | back to summary |
|---|---|
| public static final Invocable. Invoking the This invocation type is suitable for | |
| EITHER | back to summary |
|---|---|
| public static final Invocable. Invoking the This invocation type is suitable for | |
| NON_BLOCKING | back to summary |
|---|---|
| public static final Invocable. Invoking the This invocation type is suitable for | |
| InvocationType | back to summary |
|---|---|
| private InvocationType() | |
| valueOf | back to summary |
|---|---|
| public static Invocable. | |
| values | back to summary |
|---|---|
| public static Invocable. | |
A Runnable decorated with an InvocationType.
| Modifier and Type | Field and Description |
|---|---|
| private final Runnable | |
| private final Invocable. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Invocable. | |
| public void | |
| public String |
| task | back to summary |
|---|---|
| private final Runnable task | |
| type | back to summary |
|---|---|
| private final Invocable. | |
| ReadyTask | back to summary |
|---|---|
| public ReadyTask(Invocable. | |
| getInvocationType | back to summary |
|---|---|
| public Invocable. Overrides default org.
| |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
A task with an InvocationType.