public final class Http2ContainerRequestHandlingResponseWriter extends AbstractContainerRequestHandlingResponseWriter<Http2DataFrame>
AbstractContainerRequestHandlingResponseWriter
implemented in terms of Http2Headers, Http2HeadersFrames, Http2DataFrames and ByteBufBackedChannelOutboundInvokingHttp2DataFrameOutputStreams.ContainerResponseWriter.TimeoutHandlerChannelHandler.Sharable| Constructor and Description |
|---|
Http2ContainerRequestHandlingResponseWriter(ApplicationHandler applicationHandler)
Creates a new
Http2ContainerRequestHandlingResponseWriter. |
Http2ContainerRequestHandlingResponseWriter(ApplicationHandler applicationHandler,
int flushThreshold,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator byteBufCreator)
Creates a new
Http2ContainerRequestHandlingResponseWriter. |
Http2ContainerRequestHandlingResponseWriter(Supplier<? extends ApplicationHandler> applicationHandlerSupplier)
Creates a new
Http2ContainerRequestHandlingResponseWriter. |
Http2ContainerRequestHandlingResponseWriter(Supplier<? extends ApplicationHandler> applicationHandlerSupplier,
int flushThreshold,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator byteBufCreator)
Creates a new
Http2ContainerRequestHandlingResponseWriter. |
| Modifier and Type | Method and Description |
|---|---|
protected AbstractChannelOutboundInvokingOutputStream<? extends Http2DataFrame> |
createOutputStream(long contentLength,
ContainerResponse containerResponse)
Creates and returns a new
ByteBufBackedChannelOutboundInvokingHttp2DataFrameOutputStream. |
protected void |
writeFailureMessage(Throwable failureCause)
Writes an appropriate failure message using the return value of
the
AbstractContainerRequestHandlingResponseWriter.getChannelHandlerContext() method. |
protected boolean |
writeStatusAndHeaders(long contentLength,
ContainerResponse containerResponse)
Writes the status and headers portion of the response present in
the supplied
ContainerResponse and returns true
if further output is forthcoming. |
channelActive, channelRead, channelReadComplete, commit, copyHeaders, enableResponseBuffering, failure, getByteBufCreator, getChannelHandlerContext, getFlushThreshold, setSuspendTimeout, suspend, writeResponseStatusAndHeaderschannelInactive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandlerAdded, handlerRemovedpublic Http2ContainerRequestHandlingResponseWriter(ApplicationHandler applicationHandler)
Http2ContainerRequestHandlingResponseWriter.applicationHandler - an ApplicationHandler
representing a Jakarta RESTful Web Services application
whose ApplicationHandler.handle(ContainerRequest) method
will serve as the bridge between Netty and Jersey; may be null somewhat pathologically but normally is notApplicationHandler,
ApplicationHandler.handle(ContainerRequest)public Http2ContainerRequestHandlingResponseWriter(ApplicationHandler applicationHandler, int flushThreshold, AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator byteBufCreator)
Http2ContainerRequestHandlingResponseWriter.applicationHandler - an ApplicationHandler
representing a Jakarta RESTful Web Services application
whose ApplicationHandler.handle(ContainerRequest) method
will serve as the bridge between Netty and Jersey; may be null somewhat pathologically but normally is notflushThreshold - the minimum number of bytes that an AbstractChannelOutboundInvokingOutputStream returned by the
createOutputStream(long, ContainerResponse) method must
write before an automatic flush may
take place; if less than 0 0 will be used
instead; if Integer.MAX_VALUE then it is suggested that
no automatic flushing will occurbyteBufCreator - a AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator that will be used
by the createOutputStream(long, ContainerResponse)
method; may be nullApplicationHandler,
ApplicationHandler.handle(ContainerRequest)public Http2ContainerRequestHandlingResponseWriter(Supplier<? extends ApplicationHandler> applicationHandlerSupplier)
Http2ContainerRequestHandlingResponseWriter.applicationHandlerSupplier - a Supplier of an ApplicationHandler representing a Jakarta RESTful Web Services application
whose ApplicationHandler.handle(ContainerRequest) method
will serve as the bridge between Netty and Jersey; may be null somewhat pathologically but normally is notApplicationHandler,
ApplicationHandler.handle(ContainerRequest)public Http2ContainerRequestHandlingResponseWriter(Supplier<? extends ApplicationHandler> applicationHandlerSupplier, int flushThreshold, AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator byteBufCreator)
Http2ContainerRequestHandlingResponseWriter.applicationHandlerSupplier - a Supplier of an ApplicationHandler representing a Jakarta RESTful Web Services application
whose ApplicationHandler.handle(ContainerRequest) method
will serve as the bridge between Netty and Jersey; may be null somewhat pathologically but normally is notflushThreshold - the minimum number of bytes that an AbstractChannelOutboundInvokingOutputStream returned by the
createOutputStream(long, ContainerResponse) method must
write before an automatic flush may
take place; if less than 0 0 will be used
instead; if Integer.MAX_VALUE then it is suggested that
no automatic flushing will occurbyteBufCreator - a AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator that will be used
by the createOutputStream(long, ContainerResponse)
method; may be nullApplicationHandler,
ApplicationHandler.handle(ContainerRequest)protected final boolean writeStatusAndHeaders(long contentLength, ContainerResponse containerResponse)
ContainerResponse and returns true
if further output is forthcoming.
This implementation writes an instance of DefaultHttp2HeadersFrame.
writeStatusAndHeaders in class AbstractContainerRequestHandlingResponseWriter<Http2DataFrame>contentLength - the content length as determined by the
logic encapsulated by the ApplicationHandler.handle(ContainerRequest) method; a value less
than zero indicates an unknown content lengthcontainerResponse - the ContainerResponse containing
status and headers information; must not be nulltrue if the createOutputStream(long,
ContainerResponse) method should be invoked, i.e. if
further output is forthcomingNullPointerException - if containerResponse is
nullApplicationHandler.handle(ContainerRequest),
createOutputStream(long, ContainerResponse)protected final AbstractChannelOutboundInvokingOutputStream<? extends Http2DataFrame> createOutputStream(long contentLength, ContainerResponse containerResponse)
ByteBufBackedChannelOutboundInvokingHttp2DataFrameOutputStream.createOutputStream in class AbstractContainerRequestHandlingResponseWriter<Http2DataFrame>contentLength - the content length as determined by the
logic encapsulated by the ApplicationHandler.handle(ContainerRequest) method; must not be
0LcontainerResponse - a ContainerResponse for which an
AbstractChannelOutboundInvokingOutputStream is being
created and returned; must not be null; ignored by this
implementationByteBufBackedChannelOutboundInvokingHttp2DataFrameOutputStreamNullPointerException - if containerResponse is
null or if AbstractContainerRequestHandlingResponseWriter.getChannelHandlerContext() returns
nullIllegalArgumentException - if contentLength is
0LByteBufBackedChannelOutboundInvokingHttpContentOutputStreamprotected final void writeFailureMessage(Throwable failureCause)
AbstractContainerRequestHandlingResponseWriter.getChannelHandlerContext() method.writeFailureMessage in class AbstractContainerRequestHandlingResponseWriter<Http2DataFrame>failureCause - the Throwable responsible for this
method's invocation; may be null in pathological cases;
ignored by this implementationNullPointerException - if AbstractContainerRequestHandlingResponseWriter.getChannelHandlerContext() returns nullCopyright © 2019–2020, microBean™. All rights reserved.