java.lang.Runnable and org.eclipse.jetty.util.Callback
instances. These can either be shared (and mutually excluded from concurrent usage) or single usage.
The instances are autocloseable and will emit a warning if the instance is not completed within close.
try(Blocker.Runnable onAction = Blocker.runnable())
{
someMethod(onAction);
onAction.block();
}
Blocker.SharedRunnable shared = new Blocker.Shared();
// ...
try(Blocker.Runnable onAction = shared.runnable())
{
someMethod(onAction);
onAction.block();
}
try(Blocker.Callback callback = Blocker.callback())
{
someMethod(callback);
callback.block();
}
Blocker.Shared blocker = new Blocker.Shared();
// ...
try(Blocker.Callback callback = blocker.callback())
{
someMethod(callback);
callback.block();
}
| Modifier and Type | Class and Description |
|---|---|
| public static interface | |
| public static interface | |
| public static class | Blocker.
A shared reusable Blocking source. |
| Modifier and Type | Field and Description |
|---|---|
| private static final Throwable | |
| private static final Logger | |
| private static final Throwable |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static Blocker. | |
| public static Blocker. |
| ACQUIRED | back to summary |
|---|---|
| private static final Throwable ACQUIRED | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| SUCCEEDED | back to summary |
|---|---|
| private static final Throwable SUCCEEDED | |
| Blocker | back to summary |
|---|---|
| public Blocker() | |
| callback | back to summary |
|---|---|
| public static Blocker. | |
| runnable | back to summary |
|---|---|
| public static Blocker. | |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | close()
Redeclares java. Closes this resource, relinquishing any underlying resources. |
| block | back to summary |
|---|---|
| public void block() throws IOException | |
| close | back to summary |
|---|---|
| public void close() Redeclares java. Doc from java. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
| |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | close()
Redeclares java. Closes this resource, relinquishing any underlying resources. |
| block | back to summary |
|---|---|
| public void block() throws IOException | |
| close | back to summary |
|---|---|
| public void close() Redeclares java. Doc from java. Closes this resource, relinquishing any underlying resources.
This method is invoked automatically on objects managed by the
| |