public static class BodyDeferringAsyncHandler.BodyDeferringInputStream
extends java.io.FilterInputStream
| Constructor and Description |
|---|
BodyDeferringInputStream(java.util.concurrent.Future<Response> future,
BodyDeferringAsyncHandler bdah,
java.io.InputStream in) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the input stream, and "joins" (wait for complete execution
together with potential exception thrown) of the async request.
|
Response |
getAsapResponse()
Delegates to
BodyDeferringAsyncHandler.getResponse(). |
Response |
getLastResponse()
Delegates to
Future$lt;Response>#get() method. |
public BodyDeferringInputStream(java.util.concurrent.Future<Response> future, BodyDeferringAsyncHandler bdah, java.io.InputStream in)
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.FilterInputStreamjava.io.IOExceptionpublic Response getAsapResponse() throws java.lang.InterruptedException, java.io.IOException
BodyDeferringAsyncHandler.getResponse(). Will
blocks as long as headers arrives only. Might return
null. See
BodyDeferringAsyncHandler.getResponse() method for details.Responsejava.lang.InterruptedException - if the latch is interruptedjava.io.IOException - if the handler completed with an exceptionpublic Response getLastResponse() throws java.lang.InterruptedException, java.util.concurrent.ExecutionException
Future$lt;Response>#get() method. Will block
as long as complete response arrives.Responsejava.util.concurrent.ExecutionException - if the computation threw an exceptionjava.lang.InterruptedException - if the current thread was interruptedCopyright © 2018. All Rights Reserved.