- java.lang.Object
-
- org.asynchttpclient.request.body.generator.QueueBasedFeedableBodyGenerator<T>
-
- All Implemented Interfaces:
BodyGenerator,FeedableBodyGenerator
- Direct Known Subclasses:
BoundedQueueFeedableBodyGenerator,UnboundedQueueFeedableBodyGenerator
public abstract class QueueBasedFeedableBodyGenerator<T extends Queue<BodyChunk>> extends Object implements FeedableBodyGenerator
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedQueueBasedFeedableBodyGenerator(T queue)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description BodycreateBody()Creates a new instance of the request body to be read.booleanfeed(io.netty.buffer.ByteBuf buffer, boolean isLast)protected abstract booleanoffer(BodyChunk chunk)voidsetListener(FeedListener listener)
-
-
-
Constructor Detail
-
QueueBasedFeedableBodyGenerator
protected QueueBasedFeedableBodyGenerator(T queue)
-
-
Method Detail
-
createBody
public Body createBody()
Description copied from interface:BodyGeneratorCreates a new instance of the request body to be read. While each invocation of this method is supposed to create a fresh instance of the body, the actual contents of all these body instances is the same. For example, the body needs to be resent after an authentication challenge of a redirect.- Specified by:
createBodyin interfaceBodyGenerator- Returns:
- The request body, never
null.
-
feed
public boolean feed(io.netty.buffer.ByteBuf buffer, boolean isLast) throws Exception- Specified by:
feedin interfaceFeedableBodyGenerator- Throws:
Exception
-
setListener
public void setListener(FeedListener listener)
- Specified by:
setListenerin interfaceFeedableBodyGenerator
-
-