Package org.eclipse.jetty.util
Class SharedBlockingCallback
- java.lang.Object
-
- org.eclipse.jetty.util.SharedBlockingCallback
-
- Direct Known Subclasses:
BlockingWriteCallback
public class SharedBlockingCallback extends java.lang.Object
Provides a reusableCallback
that can block the thread while waiting to be completed.A typical usage pattern is:
void someBlockingCall(Object... args) throws IOException { try(Blocker blocker = sharedBlockingCallback.acquire()) { someAsyncCall(args, blocker); blocker.block(); } }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
SharedBlockingCallback.Blocker
A Closeable Callback.
-
Constructor Summary
Constructors Constructor Description SharedBlockingCallback()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SharedBlockingCallback.Blocker
acquire()
boolean
fail(java.lang.Throwable cause)
protected long
getIdleTimeout()
Deprecated.protected void
notComplete(SharedBlockingCallback.Blocker blocker)
-
-
-
Method Detail
-
getIdleTimeout
@Deprecated protected long getIdleTimeout()
Deprecated.
-
acquire
public SharedBlockingCallback.Blocker acquire() throws java.io.IOException
- Throws:
java.io.IOException
-
fail
public boolean fail(java.lang.Throwable cause)
-
notComplete
protected void notComplete(SharedBlockingCallback.Blocker blocker)
-
-