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, CreateHttpViaHeader
public 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 Closeable
close
in interface AutoCloseable
IOException
public org.apache.http.HttpHost getTarget()
getTarget
in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
public org.apache.http.HttpRequest generateRequest()
generateRequest
in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
public 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.HttpAsyncRequestProducer
IOException
public void requestCompleted(org.apache.http.protocol.HttpContext context)
requestCompleted
in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
public boolean isRepeatable()
isRepeatable
in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
public void resetRequest()
resetRequest
in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
public void failed(Exception ex)
failed
in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
Copyright © 2015–2024 Frank Stock. All rights reserved.