The InvocationType of the Runnable returned from this class is
always InvocationType#BLOCKING since a blocking task may be added to the queue
at any time.
This class was inspired by the public domain class NonBlockingMutexExecutor
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private static record |
| Modifier and Type | Field and Description |
|---|---|
| private final AtomicReference | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected String | |
| public Runnable | |
| public Runnable | |
| protected void | |
| public void | |
| public void | |
| public String |
| _tail | back to summary |
|---|---|
| private final AtomicReference<SerializedInvoker. | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| SerializedInvoker | back to summary |
|---|---|
| public SerializedInvoker() | |
| deriveTaskName | back to summary |
|---|---|
| protected String deriveTaskName(Runnable task) | |
| offer | back to summary |
|---|---|
| public Runnable offer(Runnable task) Arrange for a task to be invoked, mutually excluded from other tasks. | |
| offer | back to summary |
|---|---|
| public Runnable offer(Runnable... tasks) Arrange for tasks to be invoked, mutually excluded from other tasks. | |
| onError | back to summary |
|---|---|
| protected void onError(Runnable task, Throwable t) | |
| run | back to summary |
|---|---|
| public void run(Runnable task) Arrange for a task to be run, mutually excluded from other tasks.
This is equivalent to directly running any
| |
| run | back to summary |
|---|---|
| public void run(Runnable... tasks) Arrange for tasks to be executed, mutually excluded from other tasks.
This is equivalent to directly running any
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Field and Description |
|---|---|
| private final AtomicReference | |
| private final Runnable |
| Modifier and Type | Method and Description |
|---|---|
| public Invocable. | |
| pack-priv SerializedInvoker. | |
| public void | |
| public String |
| _next | back to summary |
|---|---|
| private final AtomicReference<SerializedInvoker. | |
| _task | back to summary |
|---|---|
| private final Runnable _task | |
| Link | back to summary |
|---|---|
| public Link(Runnable task) | |
| getInvocationType | back to summary |
|---|---|
| public Invocable. Overrides default org.
| |
| next | back to summary |
|---|---|
| pack-priv SerializedInvoker. | |
| 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. | |
| Modifier and Type | Field and Description |
|---|---|
| private final Runnable | delegate
Record Component accessed by delegate(). |
| private static final Logger | |
| private final String |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Runnable | |
| public final boolean | equals(Object
the reference object with which to compare. o)Implements abstract java. |
| public final int | |
| public String | |
| public void | |
| public String | toString()
Implements abstract java. |
| delegate | back to summary |
|---|---|
| private final Runnable delegate Record Component accessed by delegate(). | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| name | back to summary |
|---|---|
| private final String name Record Component accessed by name(). | |
| NamedRunnable | back to summary |
|---|---|
| private NamedRunnable(Runnable delegate, String name) | |
| delegate | back to summary |
|---|---|
| public Runnable delegate() Record Component getter of delegate. | |
| equals | back to summary |
|---|---|
| public final boolean equals(Object o) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public final int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of
| |
| name | back to summary |
|---|---|
| public String name() Record Component getter of name. | |
| run | back to summary |
|---|---|
| public void run() Implements java. Doc from java. Runs this operation.
| |
| toString | back to summary |
|---|---|
| public String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |