Package com.mastfrog.acteur
Class ChunkHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.SimpleChannelInboundHandler<Object>
com.mastfrog.acteur.ChunkHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
Subclasses of this can be used from the @Early annotation to provide an
object that will process inbound HTTP chunks.
- Author:
- Tim Boudreau
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected final voidchannelRead0(io.netty.channel.ChannelHandlerContext ctx, Object msg) protected abstract voidonContent(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf chunk, io.netty.handler.codec.http.HttpHeaders trailersOrHeaders, boolean done) Called with each chunk of content as it arrives.protected final voidvoidsetResumer(Deferral.Resumer resumer) Methods inherited from class io.netty.channel.SimpleChannelInboundHandler
channelReadMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
ChunkHandler
public ChunkHandler()
-
-
Method Details
-
setResumer
-
resume
-
channelRead0
-
acceptInboundMessage
-
onContent
protected abstract void onContent(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf chunk, io.netty.handler.codec.http.HttpHeaders trailersOrHeaders, boolean done) throws Exception Called with each chunk of content as it arrives. Once the final content is processed and you want to send the response, call resume() with any objects you want to add for injection into susbsequent acteurs.- Parameters:
ctx- The contextchunk- The chunktrailersOrHeaders- Trailers in the case of a LastHttpContent, headers in the case of a FullHttpRequest (non chunked)done- If this is the last one- Throws:
Exception- If something goes wrong
-