Class ServerHttp1StreamDuplexer.DelayedOutputChannel
java.lang.Object
org.apache.hc.core5.http.impl.nio.ServerHttp1StreamDuplexer.DelayedOutputChannel
- All Implemented Interfaces:
Http1StreamChannel<HttpResponse>
,ContentEncoder
- Enclosing class:
ServerHttp1StreamDuplexer
private static class ServerHttp1StreamDuplexer.DelayedOutputChannel
extends Object
implements Http1StreamChannel<HttpResponse>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Http1StreamChannel
<HttpResponse> private boolean
private HttpResponse
private boolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
-
Method Summary
Modifier and TypeMethodDescriptionboolean
void
activate()
void
close()
void
Terminates the content stream.boolean
Returnstrue
if the entity has been transferred in its entirety.void
void
setSocketTimeout
(Timeout timeout) void
submit
(HttpResponse response, boolean endStream, FlushMode flushMode) void
int
write
(ByteBuffer src) Writes a portion of entity content to the underlying channel.
-
Field Details
-
channel
-
direct
private volatile boolean direct -
delayedResponse
-
completed
private volatile boolean completed
-
-
Constructor Details
-
DelayedOutputChannel
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceHttp1StreamChannel<HttpResponse>
-
submit
public void submit(HttpResponse response, boolean endStream, FlushMode flushMode) throws HttpException, IOException - Specified by:
submit
in interfaceHttp1StreamChannel<HttpResponse>
- Throws:
HttpException
IOException
-
suspendOutput
- Specified by:
suspendOutput
in interfaceHttp1StreamChannel<HttpResponse>
- Throws:
IOException
-
requestOutput
public void requestOutput()- Specified by:
requestOutput
in interfaceHttp1StreamChannel<HttpResponse>
-
getSocketTimeout
- Specified by:
getSocketTimeout
in interfaceHttp1StreamChannel<HttpResponse>
-
setSocketTimeout
- Specified by:
setSocketTimeout
in interfaceHttp1StreamChannel<HttpResponse>
-
write
Description copied from interface:ContentEncoder
Writes a portion of entity content to the underlying channel.- Specified by:
write
in interfaceContentEncoder
- Parameters:
src
- The buffer from which content is to be retrieved- Returns:
- The number of bytes read, possibly zero
- Throws:
IOException
- if I/O error occurs while writing content
-
complete
Description copied from interface:ContentEncoder
Terminates the content stream.- Specified by:
complete
in interfaceContentEncoder
- Throws:
IOException
- if I/O error occurs while writing content
-
abortGracefully
- Specified by:
abortGracefully
in interfaceHttp1StreamChannel<HttpResponse>
- Throws:
IOException
-
isCompleted
public boolean isCompleted()Description copied from interface:ContentEncoder
Returnstrue
if the entity has been transferred in its entirety.- Specified by:
isCompleted
in interfaceContentEncoder
- Returns:
true
if all the content has been produced,false
otherwise.
-
activate
- Specified by:
activate
in interfaceHttp1StreamChannel<HttpResponse>
- Throws:
IOException
HttpException
-