Class ServerHttp1StreamHandler
- java.lang.Object
-
- org.apache.hc.core5.http.impl.nio.ServerHttp1StreamHandler
-
- All Implemented Interfaces:
ResourceHolder
class ServerHttp1StreamHandler extends java.lang.Object implements ResourceHolder
-
-
Field Summary
Fields Modifier and Type Field Description private ConnectionReuseStrategy
connectionReuseStrategy
private HttpCoreContext
context
private java.util.concurrent.atomic.AtomicBoolean
done
private AsyncServerExchangeHandler
exchangeHandler
private HandlerFactory<AsyncServerExchangeHandler>
exchangeHandlerFactory
private HttpProcessor
httpProcessor
private DataStreamChannel
internalDataChannel
private boolean
keepAlive
private Http1StreamChannel<HttpResponse>
outputChannel
private HttpRequest
receivedRequest
private MessageState
requestState
private ResponseChannel
responseChannel
private java.util.concurrent.atomic.AtomicBoolean
responseCommitted
private MessageState
responseState
-
Constructor Summary
Constructors Constructor Description ServerHttp1StreamHandler(Http1StreamChannel<HttpResponse> outputChannel, HttpProcessor httpProcessor, ConnectionReuseStrategy connectionReuseStrategy, HandlerFactory<AsyncServerExchangeHandler> exchangeHandlerFactory, HttpCoreContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
activateChannel()
(package private) void
appendState(java.lang.StringBuilder buf)
private void
commitInformation(HttpResponse response)
private void
commitPromise()
private void
commitResponse(HttpResponse response, EntityDetails responseEntityDetails)
(package private) void
consumeData(java.nio.ByteBuffer src)
(package private) void
consumeHeader(HttpRequest request, EntityDetails requestEntityDetails)
(package private) void
dataEnd(java.util.List<? extends Header> trailers)
(package private) void
failed(java.lang.Exception cause)
(package private) boolean
isCompleted()
(package private) boolean
isOutputReady()
(package private) boolean
isResponseFinal()
(package private) boolean
keepAlive()
(package private) void
produceOutput()
void
releaseResources()
(package private) void
terminateExchange(HttpException ex)
java.lang.String
toString()
(package private) void
updateCapacity(CapacityChannel capacityChannel)
-
-
-
Field Detail
-
outputChannel
private final Http1StreamChannel<HttpResponse> outputChannel
-
internalDataChannel
private final DataStreamChannel internalDataChannel
-
responseChannel
private final ResponseChannel responseChannel
-
httpProcessor
private final HttpProcessor httpProcessor
-
exchangeHandlerFactory
private final HandlerFactory<AsyncServerExchangeHandler> exchangeHandlerFactory
-
connectionReuseStrategy
private final ConnectionReuseStrategy connectionReuseStrategy
-
context
private final HttpCoreContext context
-
responseCommitted
private final java.util.concurrent.atomic.AtomicBoolean responseCommitted
-
done
private final java.util.concurrent.atomic.AtomicBoolean done
-
keepAlive
private volatile boolean keepAlive
-
exchangeHandler
private volatile AsyncServerExchangeHandler exchangeHandler
-
receivedRequest
private volatile HttpRequest receivedRequest
-
requestState
private volatile MessageState requestState
-
responseState
private volatile MessageState responseState
-
-
Constructor Detail
-
ServerHttp1StreamHandler
ServerHttp1StreamHandler(Http1StreamChannel<HttpResponse> outputChannel, HttpProcessor httpProcessor, ConnectionReuseStrategy connectionReuseStrategy, HandlerFactory<AsyncServerExchangeHandler> exchangeHandlerFactory, HttpCoreContext context)
-
-
Method Detail
-
commitResponse
private void commitResponse(HttpResponse response, EntityDetails responseEntityDetails) throws HttpException, java.io.IOException
- Throws:
HttpException
java.io.IOException
-
commitInformation
private void commitInformation(HttpResponse response) throws java.io.IOException, HttpException
- Throws:
java.io.IOException
HttpException
-
commitPromise
private void commitPromise() throws HttpException
- Throws:
HttpException
-
activateChannel
void activateChannel() throws java.io.IOException, HttpException
- Throws:
java.io.IOException
HttpException
-
isResponseFinal
boolean isResponseFinal()
-
keepAlive
boolean keepAlive()
-
isCompleted
boolean isCompleted()
-
terminateExchange
void terminateExchange(HttpException ex) throws HttpException, java.io.IOException
- Throws:
HttpException
java.io.IOException
-
consumeHeader
void consumeHeader(HttpRequest request, EntityDetails requestEntityDetails) throws HttpException, java.io.IOException
- Throws:
HttpException
java.io.IOException
-
isOutputReady
boolean isOutputReady()
-
produceOutput
void produceOutput() throws HttpException, java.io.IOException
- Throws:
HttpException
java.io.IOException
-
consumeData
void consumeData(java.nio.ByteBuffer src) throws HttpException, java.io.IOException
- Throws:
HttpException
java.io.IOException
-
updateCapacity
void updateCapacity(CapacityChannel capacityChannel) throws java.io.IOException
- Throws:
java.io.IOException
-
dataEnd
void dataEnd(java.util.List<? extends Header> trailers) throws HttpException, java.io.IOException
- Throws:
HttpException
java.io.IOException
-
failed
void failed(java.lang.Exception cause)
-
releaseResources
public void releaseResources()
- Specified by:
releaseResources
in interfaceResourceHolder
-
appendState
void appendState(java.lang.StringBuilder buf)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-