Class AsyncEchoHandler
java.lang.Object
org.apache.hc.client5.testing.async.AsyncEchoHandler
- All Implemented Interfaces:
org.apache.hc.core5.http.nio.AsyncDataConsumer,org.apache.hc.core5.http.nio.AsyncDataExchangeHandler,org.apache.hc.core5.http.nio.AsyncDataProducer,org.apache.hc.core5.http.nio.AsyncServerExchangeHandler,org.apache.hc.core5.http.nio.ResourceHolder
public class AsyncEchoHandler
extends Object
implements org.apache.hc.core5.http.nio.AsyncServerExchangeHandler
A handler that echos the incoming request entity.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.hc.core5.http.nio.entity.BasicAsyncEntityConsumerprivate final AtomicReference<org.apache.hc.core5.http.nio.AsyncEntityProducer> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintvoidconsume(ByteBuffer src) voidvoidhandleRequest(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.EntityDetails entityDetails, org.apache.hc.core5.http.nio.ResponseChannel responseChannel, org.apache.hc.core5.http.protocol.HttpContext context) voidproduce(org.apache.hc.core5.http.nio.DataStreamChannel channel) voidvoidvoidupdateCapacity(org.apache.hc.core5.http.nio.CapacityChannel capacityChannel)
-
Field Details
-
entityConsumer
private final org.apache.hc.core5.http.nio.entity.BasicAsyncEntityConsumer entityConsumer -
entityProducerRef
-
-
Constructor Details
-
AsyncEchoHandler
public AsyncEchoHandler()
-
-
Method Details
-
releaseResources
public void releaseResources()- Specified by:
releaseResourcesin interfaceorg.apache.hc.core5.http.nio.ResourceHolder
-
handleRequest
public void handleRequest(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.EntityDetails entityDetails, org.apache.hc.core5.http.nio.ResponseChannel responseChannel, org.apache.hc.core5.http.protocol.HttpContext context) throws org.apache.hc.core5.http.HttpException, IOException - Specified by:
handleRequestin interfaceorg.apache.hc.core5.http.nio.AsyncServerExchangeHandler- Throws:
org.apache.hc.core5.http.HttpExceptionIOException
-
updateCapacity
public void updateCapacity(org.apache.hc.core5.http.nio.CapacityChannel capacityChannel) throws IOException - Specified by:
updateCapacityin interfaceorg.apache.hc.core5.http.nio.AsyncDataConsumer- Throws:
IOException
-
consume
- Specified by:
consumein interfaceorg.apache.hc.core5.http.nio.AsyncDataConsumer- Throws:
IOException
-
streamEnd
public void streamEnd(List<? extends org.apache.hc.core5.http.Header> trailers) throws org.apache.hc.core5.http.HttpException, IOException - Specified by:
streamEndin interfaceorg.apache.hc.core5.http.nio.AsyncDataConsumer- Throws:
org.apache.hc.core5.http.HttpExceptionIOException
-
available
public int available()- Specified by:
availablein interfaceorg.apache.hc.core5.http.nio.AsyncDataProducer
-
produce
- Specified by:
producein interfaceorg.apache.hc.core5.http.nio.AsyncDataProducer- Throws:
IOException
-
failed
- Specified by:
failedin interfaceorg.apache.hc.core5.http.nio.AsyncDataExchangeHandler
-