Class SharedBlockingCallback.Blocker
java.lang.Object
org.eclipse.jetty.util.SharedBlockingCallback.Blocker
- All Implemented Interfaces:
Closeable, AutoCloseable, Runnable, Callback, Invocable
- Enclosing class:
SharedBlockingCallback
-
Nested Class Summary
Nested classes/interfaces inherited from interface Callback
Callback.Completable, Callback.Completing, Callback.NestedNested classes/interfaces inherited from interface Invocable
Invocable.Callable, Invocable.InvocationType, Invocable.ReadyTask, Invocable.Task -
Field Summary
Fields inherited from interface Invocable
__nonBlocking -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidblock()Block until the Callback has succeeded or failed and after the return leave in the state to allow reuse.voidclose()Check the Callback has succeeded or failed and after the return leave in the state to allow reuse.voidCallback invoked when the operation fails.voidrun()voidCallback invoked when the operation completes.toString()Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Callback
completeWith
-
Constructor Details
-
Blocker
protected Blocker()
-
-
Method Details
-
getInvocationType
- Specified by:
getInvocationTypein interfaceInvocable- Returns:
- The InvocationType of this object
-
run
-
succeeded
-
failed
-
block
Block until the Callback has succeeded or failed and after the return leave in the state to allow reuse. This is useful for code that wants to repeatable use a FutureCallback to convert an asynchronous API to a blocking API.- Throws:
IOException- if exception was caught during blocking, or callback was cancelled
-
close
public void close()Check the Callback has succeeded or failed and after the return leave in the state to allow reuse.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
toString
-