some
future, and do some work registered through the Executor interface while waiting.
The purpose of this is to make execution of synchronous methods look more synchronous, e.g. stack traces should actually contain the caller.
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final Condition | |
| private final Lock | |
| private final Queue |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | execute(Runnable
the runnable task command)Implements java. Executes the given command at some time in the future. |
| public <R> R |
| condition | back to summary |
|---|---|
| private final Condition condition | |
| lock | back to summary |
|---|---|
| private final Lock lock | |
| tasks | back to summary |
|---|---|
| private final Queue<Runnable> tasks | |
| SyncFutureWaiter | back to summary |
|---|---|
| public SyncFutureWaiter() | |
| execute | back to summary |
|---|---|
| public void execute(Runnable command) Implements java. Doc from java. Executes the given command at some time in the future. The command
may execute in a new thread, in a pooled thread, or in the calling
thread, at the discretion of the | |
| listenForResult | back to summary |
|---|---|
| public <R> R listenForResult(CompletionStage<R> stage) throws Throwable | |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private Throwable | |
| private R |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public R |
| complete | back to summary |
|---|---|
| private boolean complete | |
| failure | back to summary |
|---|---|
| private Throwable failure | |
| result | back to summary |
|---|---|
| private R result | |
| Waiter | back to summary |
|---|---|
| private Waiter() | |
| listenForResult | back to summary |
|---|---|
| public void listenForResult(CompletionStage<R> stage) | |
| waitAndWork | back to summary |
|---|---|
| public R waitAndWork() throws InterruptedException, Throwable | |