public class TargetRequestProducer extends TargetBase implements org.apache.http.nio.protocol.HttpAsyncRequestProducer
BufferIOController to coordinate reading flow control from the RequestForTargetConsumer's incoming request content buffer.
For this reason, this class has the responsibility for closing the buffer that was given to the RequestForTargetConsumer by the RequestHandler| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
Logger |
Via| Constructor and Description |
|---|
TargetRequestProducer(TargetDescriptor targetDesc,
org.apache.http.HttpRequest clientRequest,
org.apache.http.protocol.HttpContext context,
BufferIOController buffer)
Primary constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the content buffer given to us by the
RequestForTargetConsumer. |
void |
failed(Exception ex) |
org.apache.http.HttpRequest |
generateRequest() |
org.apache.http.HttpHost |
getTarget() |
boolean |
isRepeatable()
This class is not repeatable as it is created solely for this transaction.
|
void |
produceContent(org.apache.http.nio.ContentEncoder encoder,
org.apache.http.nio.IOControl ioctrl)
This method is only called if the request has content (e.g.
|
void |
requestCompleted(org.apache.http.protocol.HttpContext context) |
void |
resetRequest()
Does nothing as this class is not repeatable because it is created solely for this transaction.
|
BuildHeaderRemovalList, CreateHttpViaHeaderpublic TargetRequestProducer(TargetDescriptor targetDesc, org.apache.http.HttpRequest clientRequest, org.apache.http.protocol.HttpContext context, BufferIOController buffer)
targetDesc - The remote TargetclientRequest - The request we received from the client.context - The context of this request / response transaction.buffer - The buffer containing the content (if any) of the original request from the client.public void close()
throws IOException
RequestForTargetConsumer.close in interface Closeableclose in interface AutoCloseableIOExceptionpublic org.apache.http.HttpHost getTarget()
getTarget in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerpublic org.apache.http.HttpRequest generateRequest()
generateRequest in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerpublic void produceContent(org.apache.http.nio.ContentEncoder encoder,
org.apache.http.nio.IOControl ioctrl)
throws IOException
RequestForTargetConsumer has asynchronously written into), reads the request data and encodes it out to the remote Target.produceContent in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerIOExceptionpublic void requestCompleted(org.apache.http.protocol.HttpContext context)
requestCompleted in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerpublic boolean isRepeatable()
isRepeatable in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerpublic void resetRequest()
resetRequest in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerpublic void failed(Exception ex)
failed in interface org.apache.http.nio.protocol.HttpAsyncRequestProducerCopyright © 2015–2024 Frank Stock. All rights reserved.