Package org.eclipse.jetty.util
Class SharedBlockingCallback.Blocker
- java.lang.Object
-
- org.eclipse.jetty.util.SharedBlockingCallback.Blocker
-
- Enclosing class:
- SharedBlockingCallback
public class SharedBlockingCallback.Blocker extends java.lang.Object implements Callback, java.io.Closeable
-
-
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
-
-
Field Summary
-
Fields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBlocker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidblock()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.voidfailed(java.lang.Throwable cause)Callback invoked when the operation fails.Invocable.InvocationTypegetInvocationType()voidsucceeded()Callback invoked when the operation completes.java.lang.StringtoString()
-
-
-
Method Detail
-
getInvocationType
public Invocable.InvocationType getInvocationType()
- Specified by:
getInvocationTypein interfaceInvocable- Returns:
- The InvocationType of this object
-
succeeded
public void succeeded()
Description copied from interface:CallbackCallback invoked when the operation completes.
- Specified by:
succeededin interfaceCallback- See Also:
Callback.failed(Throwable)
-
failed
public void failed(java.lang.Throwable cause)
Description copied from interface:CallbackCallback invoked when the operation fails.
-
block
public void block() throws java.io.IOExceptionBlock 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:
java.io.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 interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-