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 ConnectionReuseStrategyconnectionReuseStrategyprivate HttpCoreContextcontextprivate java.util.concurrent.atomic.AtomicBooleandoneprivate AsyncServerExchangeHandlerexchangeHandlerprivate HandlerFactory<AsyncServerExchangeHandler>exchangeHandlerFactoryprivate HttpProcessorhttpProcessorprivate DataStreamChannelinternalDataChannelprivate booleankeepAliveprivate Http1StreamChannel<HttpResponse>outputChannelprivate HttpRequestreceivedRequestprivate MessageStaterequestStateprivate ResponseChannelresponseChannelprivate java.util.concurrent.atomic.AtomicBooleanresponseCommittedprivate MessageStateresponseState
-
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) voidactivateChannel()(package private) voidappendState(java.lang.StringBuilder buf)private voidcommitInformation(HttpResponse response)private voidcommitPromise()private voidcommitResponse(HttpResponse response, EntityDetails responseEntityDetails)(package private) voidconsumeData(java.nio.ByteBuffer src)(package private) voidconsumeHeader(HttpRequest request, EntityDetails requestEntityDetails)(package private) voiddataEnd(java.util.List<? extends Header> trailers)(package private) voidfailed(java.lang.Exception cause)(package private) booleanisCompleted()(package private) booleanisOutputReady()(package private) booleanisResponseFinal()(package private) booleankeepAlive()(package private) voidproduceOutput()voidreleaseResources()(package private) voidterminateExchange(HttpException ex)java.lang.StringtoString()(package private) voidupdateCapacity(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:
HttpExceptionjava.io.IOException
-
commitInformation
private void commitInformation(HttpResponse response) throws java.io.IOException, HttpException
- Throws:
java.io.IOExceptionHttpException
-
commitPromise
private void commitPromise() throws HttpException- Throws:
HttpException
-
activateChannel
void activateChannel() throws java.io.IOException, HttpException- Throws:
java.io.IOExceptionHttpException
-
isResponseFinal
boolean isResponseFinal()
-
keepAlive
boolean keepAlive()
-
isCompleted
boolean isCompleted()
-
terminateExchange
void terminateExchange(HttpException ex) throws HttpException, java.io.IOException
- Throws:
HttpExceptionjava.io.IOException
-
consumeHeader
void consumeHeader(HttpRequest request, EntityDetails requestEntityDetails) throws HttpException, java.io.IOException
- Throws:
HttpExceptionjava.io.IOException
-
isOutputReady
boolean isOutputReady()
-
produceOutput
void produceOutput() throws HttpException, java.io.IOException- Throws:
HttpExceptionjava.io.IOException
-
consumeData
void consumeData(java.nio.ByteBuffer src) throws HttpException, java.io.IOException- Throws:
HttpExceptionjava.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:
HttpExceptionjava.io.IOException
-
failed
void failed(java.lang.Exception cause)
-
releaseResources
public void releaseResources()
- Specified by:
releaseResourcesin interfaceResourceHolder
-
appendState
void appendState(java.lang.StringBuilder buf)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-