Package org.eclipse.jetty.util
Class SharedBlockingCallback.Blocker
java.lang.Object
org.eclipse.jetty.util.SharedBlockingCallback.Blocker
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Callback
,Invocable
- Enclosing class:
- SharedBlockingCallback
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Callback
Callback.Completable, Callback.Completing, Callback.Nested
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
Invocable.InvocationType, Invocable.ReadyTask, Invocable.Task
-
Field Summary
Fields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
block()
Block until the Callback has succeeded or failed and after the return leave in the state to allow reuse.void
close()
Check the Callback has succeeded or failed and after the return leave in the state to allow reuse.void
Callback invoked when the operation fails.void
Callback invoked when the operation completes.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.Callback
completeWith
-
Constructor Details
-
Blocker
protected Blocker()
-
-
Method Details
-
getInvocationType
- Specified by:
getInvocationType
in interfaceInvocable
- Returns:
- The InvocationType of this object
-
succeeded
public void succeeded()Description copied from interface:Callback
Callback invoked when the operation completes.
-
failed
Description copied from interface:Callback
Callback invoked when the operation fails.
-
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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
toString
-