Class HttpServerCodec.HttpServerResponseEncoder
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelOutboundHandlerAdapter
io.netty.handler.codec.MessageToMessageEncoder<Object>
io.netty.handler.codec.http.HttpObjectEncoder<HttpResponse>
io.netty.handler.codec.http.HttpResponseEncoder
io.netty.handler.codec.http.HttpServerCodec.HttpServerResponseEncoder
- All Implemented Interfaces:
ChannelHandler, ChannelOutboundHandler
- Enclosing class:
HttpServerCodec
-
Nested Class Summary
Nested classes/interfaces inherited from interface ChannelHandler
ChannelHandler.Sharable -
Field Summary
FieldsFields inherited from class HttpObjectEncoder
CRLF_SHORT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanDetermine whether a message has a content or not.protected voidsanitizeHeadersBeforeEncode(HttpResponse msg, boolean isAlwaysEmpty) Allows to sanitize headers of the message before encoding these.voidwrite(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) CallsChannelOutboundInvoker.write(Object, ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline.Methods inherited from class HttpResponseEncoder
acceptOutboundMessage, encodeInitialLineMethods inherited from class HttpObjectEncoder
encode, encodeAscii, encodeHeadersMethods inherited from class ChannelOutboundHandlerAdapter
bind, close, connect, deregister, disconnect, flush, readMethods inherited from class ChannelHandlerAdapter
ensureNotSharable, exceptionCaught, handlerAdded, handlerRemoved, isSharableMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ChannelHandler
exceptionCaught, handlerAdded, handlerRemoved
-
Field Details
-
method
-
-
Constructor Details
-
HttpServerResponseEncoder
private HttpServerResponseEncoder()
-
-
Method Details
-
write
Description copied from class:ChannelOutboundHandlerAdapterCallsChannelOutboundInvoker.write(Object, ChannelPromise)to forward to the nextChannelOutboundHandlerin theChannelPipeline. Sub-classes may override this method to change behavior.- Specified by:
writein interfaceChannelOutboundHandler- Overrides:
writein classHttpObjectEncoder<HttpResponse>- Parameters:
ctx- theChannelHandlerContextfor which the write operation is mademsg- the message to writepromise- theChannelPromiseto notify once the operation completes- Throws:
Exception- thrown if an error occurs
-
sanitizeHeadersBeforeEncode
Description copied from class:HttpObjectEncoderAllows to sanitize headers of the message before encoding these.- Overrides:
sanitizeHeadersBeforeEncodein classHttpResponseEncoder
-
isContentAlwaysEmpty
Description copied from class:HttpObjectEncoderDetermine whether a message has a content or not. Some message may have headers indicating a content without having an actual content, e.g the response to an HEAD or CONNECT request.- Overrides:
isContentAlwaysEmptyin classHttpResponseEncoder- Parameters:
msg- the message to test- Returns:
trueto signal the message has no content
-