public class JerseyChannelInitializer extends ChannelInitializer<Channel>
ChannelInitializer
that initializes
Channel
s by configuring their ChannelPipeline
s to include ChannelHandler
s that transform
Netty HTTP and HTTP/2 messages into Jersey ContainerRequest
s that are then handled by an ApplicationHandler
.ChannelHandler.Sharable
Constructor and Description |
---|
JerseyChannelInitializer(URI baseUri,
SslContext sslContext,
Application jaxrsApplication)
Creates a new
JerseyChannelInitializer . |
JerseyChannelInitializer(URI baseUri,
SslContext sslContext,
ApplicationHandler applicationHandler)
Creates a new
JerseyChannelInitializer . |
JerseyChannelInitializer(URI baseUri,
SslContext sslContext,
boolean http2Support,
Application jaxrsApplication)
Creates a new
JerseyChannelInitializer . |
JerseyChannelInitializer(URI baseUri,
SslContext sslContext,
boolean http2Support,
ApplicationHandler applicationHandler)
Creates a new
JerseyChannelInitializer . |
JerseyChannelInitializer(URI baseUri,
SslContext sslContext,
boolean http2Support,
long maxIncomingContentLength,
EventExecutorGroup jerseyEventExecutorGroup,
ApplicationHandler applicationHandler,
int flushThreshold,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator byteBufCreator)
Creates a new
JerseyChannelInitializer . |
JerseyChannelInitializer(URI baseUri,
SslContext sslContext,
boolean http2Support,
long maxIncomingContentLength,
EventExecutorGroup jerseyEventExecutorGroup,
Application jaxrsApplication,
int flushThreshold,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator byteBufCreator)
Creates a new
JerseyChannelInitializer . |
JerseyChannelInitializer(URI baseUri,
SslContext sslContext,
boolean http2Support,
long maxIncomingContentLength,
EventExecutorGroup jerseyEventExecutorGroup,
boolean useJerseyInjection,
ApplicationHandler applicationHandler,
int flushThreshold,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator byteBufCreator)
Creates a new
JerseyChannelInitializer . |
JerseyChannelInitializer(URI baseUri,
SslContext sslContext,
boolean http2Support,
long maxIncomingContentLength,
EventExecutorGroup jerseyEventExecutorGroup,
boolean useJerseyInjection,
Supplier<? extends ApplicationHandler> applicationHandlerSupplier,
int flushThreshold,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator byteBufCreator)
Creates a new
JerseyChannelInitializer . |
JerseyChannelInitializer(URI baseUri,
SslContext sslContext,
boolean http2Support,
long maxIncomingContentLength,
EventExecutorGroup jerseyEventExecutorGroup,
Supplier<? extends ApplicationHandler> applicationHandlerSupplier,
int flushThreshold,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator byteBufCreator)
Creates a new
JerseyChannelInitializer . |
JerseyChannelInitializer(URI baseUri,
SslContext sslContext,
boolean http2Support,
Supplier<? extends ApplicationHandler> applicationHandlerSupplier)
Creates a new
JerseyChannelInitializer . |
JerseyChannelInitializer(URI baseUri,
SslContext sslContext,
Supplier<? extends ApplicationHandler> applicationHandlerSupplier)
Creates a new
JerseyChannelInitializer . |
Modifier and Type | Method and Description |
---|---|
protected SslHandler |
createSslHandler(SslContext sslContext,
ByteBufAllocator byteBufAllocator)
Creates and returns a new
SslHandler when invoked. |
URI |
getBaseUri()
Returns the
URI that was supplied at construction time. |
EventExecutorGroup |
getJerseyEventExecutorGroup()
Returns the
EventExecutorGroup that this JerseyChannelInitializer will use to offload blocking work from
the Netty event loop. |
protected void |
initChannel(Channel channel)
Initializes the supplied
Channel using an appropriate
sequencing of several ChannelHandler s and other Netty
utility classes. |
channelRegistered, exceptionCaught, handlerAdded, handlerRemoved
channelActive, channelInactive, channelRead, channelReadComplete, channelUnregistered, channelWritabilityChanged, userEventTriggered
ensureNotSharable, isSharable
public JerseyChannelInitializer(URI baseUri, SslContext sslContext, Application jaxrsApplication)
JerseyChannelInitializer
.baseUri
- a URI
that will serve as the base URI
in a new
ContainerRequest
; may be null
in which case the
return value of URI.create("/")
will
be used insteadsslContext
- an SslContext
; may be null
in
which case network communications will occur in plain textjaxrsApplication
- the Application
to run; may be
null
somewhat pathologicallyJerseyChannelInitializer(URI, SslContext, boolean, long,
EventExecutorGroup, boolean, Supplier, int,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator)
,
ContainerRequest
,
SslContext
,
HttpServerUpgradeHandler.HttpServerUpgradeHandler(SourceCodec,
UpgradeCodecFactory, int)
,
ApplicationHandler.handle(ContainerRequest)
,
AbstractContainerRequestHandlingResponseWriter
,
HttpObjectToContainerRequestDecoder
,
HttpContainerRequestHandlingResponseWriter
,
Http2StreamFrameToContainerRequestDecoder
,
Http2ContainerRequestHandlingResponseWriter
public JerseyChannelInitializer(URI baseUri, SslContext sslContext, ApplicationHandler applicationHandler)
JerseyChannelInitializer
.baseUri
- a URI
that will serve as the base URI
in a new
ContainerRequest
; may be null
in which case the
return value of URI.create("/")
will
be used insteadsslContext
- an SslContext
; may be null
in
which case network communications will occur in plain textapplicationHandler
- 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 notJerseyChannelInitializer(URI, SslContext, boolean, long,
EventExecutorGroup, boolean, Supplier, int,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator)
,
ContainerRequest
,
SslContext
,
HttpServerUpgradeHandler.HttpServerUpgradeHandler(SourceCodec,
UpgradeCodecFactory, int)
,
ApplicationHandler.handle(ContainerRequest)
,
AbstractContainerRequestHandlingResponseWriter
,
HttpObjectToContainerRequestDecoder
,
HttpContainerRequestHandlingResponseWriter
,
Http2StreamFrameToContainerRequestDecoder
,
Http2ContainerRequestHandlingResponseWriter
public JerseyChannelInitializer(URI baseUri, SslContext sslContext, Supplier<? extends ApplicationHandler> applicationHandlerSupplier)
JerseyChannelInitializer
.baseUri
- a URI
that will serve as the base URI
in a new
ContainerRequest
; may be null
in which case the
return value of URI.create("/")
will
be used insteadsslContext
- an SslContext
; may be null
in
which case network communications will occur in plain textapplicationHandlerSupplier
- 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 notJerseyChannelInitializer(URI, SslContext, boolean, long,
EventExecutorGroup, boolean, Supplier, int,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator)
,
ContainerRequest
,
SslContext
,
HttpServerUpgradeHandler.HttpServerUpgradeHandler(SourceCodec,
UpgradeCodecFactory, int)
,
ApplicationHandler.handle(ContainerRequest)
,
AbstractContainerRequestHandlingResponseWriter
,
HttpObjectToContainerRequestDecoder
,
HttpContainerRequestHandlingResponseWriter
,
Http2StreamFrameToContainerRequestDecoder
,
Http2ContainerRequestHandlingResponseWriter
public JerseyChannelInitializer(URI baseUri, SslContext sslContext, boolean http2Support, Application jaxrsApplication)
JerseyChannelInitializer
.baseUri
- a URI
that will serve as the base URI
in a new
ContainerRequest
; may be null
in which case the
return value of URI.create("/")
will
be used insteadsslContext
- an SslContext
; may be null
in
which case network communications will occur in plain texthttp2Support
- if HTTP/2 support (including upgrades, prior
knowledge, h2c, etc.) should be enabledjaxrsApplication
- the Application
to run; may be
null
somewhat pathologicallyJerseyChannelInitializer(URI, SslContext, boolean, long,
EventExecutorGroup, boolean, Supplier, int,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator)
,
ContainerRequest
,
SslContext
,
HttpServerUpgradeHandler.HttpServerUpgradeHandler(SourceCodec,
UpgradeCodecFactory, int)
,
ApplicationHandler.handle(ContainerRequest)
,
AbstractContainerRequestHandlingResponseWriter
,
HttpObjectToContainerRequestDecoder
,
HttpContainerRequestHandlingResponseWriter
,
Http2StreamFrameToContainerRequestDecoder
,
Http2ContainerRequestHandlingResponseWriter
public JerseyChannelInitializer(URI baseUri, SslContext sslContext, boolean http2Support, ApplicationHandler applicationHandler)
JerseyChannelInitializer
.baseUri
- a URI
that will serve as the base URI
in a new
ContainerRequest
; may be null
in which case the
return value of URI.create("/")
will
be used insteadsslContext
- an SslContext
; may be null
in
which case network communications will occur in plain texthttp2Support
- if HTTP/2 support (including upgrades, prior
knowledge, h2c, etc.) should be enabledapplicationHandler
- 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 notJerseyChannelInitializer(URI, SslContext, boolean, long,
EventExecutorGroup, boolean, Supplier, int,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator)
,
ContainerRequest
,
SslContext
,
HttpServerUpgradeHandler.HttpServerUpgradeHandler(SourceCodec,
UpgradeCodecFactory, int)
,
ApplicationHandler.handle(ContainerRequest)
,
AbstractContainerRequestHandlingResponseWriter
,
HttpObjectToContainerRequestDecoder
,
HttpContainerRequestHandlingResponseWriter
,
Http2StreamFrameToContainerRequestDecoder
,
Http2ContainerRequestHandlingResponseWriter
public JerseyChannelInitializer(URI baseUri, SslContext sslContext, boolean http2Support, Supplier<? extends ApplicationHandler> applicationHandlerSupplier)
JerseyChannelInitializer
.baseUri
- a URI
that will serve as the base URI
in a new
ContainerRequest
; may be null
in which case the
return value of URI.create("/")
will
be used insteadsslContext
- an SslContext
; may be null
in
which case network communications will occur in plain texthttp2Support
- if HTTP/2 support (including upgrades, prior
knowledge, h2c, etc.) should be enabledapplicationHandlerSupplier
- 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 notJerseyChannelInitializer(URI, SslContext, boolean, long,
EventExecutorGroup, boolean, Supplier, int,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator)
,
ContainerRequest
,
SslContext
,
HttpServerUpgradeHandler.HttpServerUpgradeHandler(SourceCodec,
UpgradeCodecFactory, int)
,
ApplicationHandler.handle(ContainerRequest)
,
AbstractContainerRequestHandlingResponseWriter
,
HttpObjectToContainerRequestDecoder
,
HttpContainerRequestHandlingResponseWriter
,
Http2StreamFrameToContainerRequestDecoder
,
Http2ContainerRequestHandlingResponseWriter
public JerseyChannelInitializer(URI baseUri, SslContext sslContext, boolean http2Support, long maxIncomingContentLength, EventExecutorGroup jerseyEventExecutorGroup, Application jaxrsApplication, int flushThreshold, AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator byteBufCreator)
JerseyChannelInitializer
.baseUri
- a URI
that will serve as the base URI
in a new
ContainerRequest
; may be null
in which case the
return value of URI.create("/")
will
be used insteadsslContext
- an SslContext
; may be null
in
which case network communications will occur in plain texthttp2Support
- if HTTP/2 support (including upgrades, prior
knowledge, h2c, etc.) should be enabledmaxIncomingContentLength
- in the case of HTTP to HTTP/2
upgrades, a long
that governs the maximum permitted
incoming entity length in bytes; if less than 0
then
Long.MAX_VALUE
will be used instead; if exactly 0
then if the HTTP message containing the upgrade header is
something like a POST
it will be rejected with a 413
error code; ignored entirely if http2Support
is
false
jerseyEventExecutorGroup
- an EventExecutorGroup
that will manage the thread on which an ApplicationHandler.handle(ContainerRequest)
call will occur; may
be null
in which case a new DefaultEventExecutorGroup
will be used insteadjaxrsApplication
- the Application
to run; may be
null
somewhat pathologicallyflushThreshold
- the minimum number of bytes that an AbstractByteBufBackedChannelOutboundInvokingOutputStream
returned by an implementation of the AbstractContainerRequestHandlingResponseWriter.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
passed to an
AbstractContainerRequestHandlingResponseWriter
implementation; may be null
JerseyChannelInitializer(URI, SslContext, boolean, long,
EventExecutorGroup, boolean, Supplier, int,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator)
,
ContainerRequest
,
SslContext
,
HttpServerUpgradeHandler.HttpServerUpgradeHandler(SourceCodec,
UpgradeCodecFactory, int)
,
ApplicationHandler.handle(ContainerRequest)
,
AbstractContainerRequestHandlingResponseWriter
,
HttpObjectToContainerRequestDecoder
,
HttpContainerRequestHandlingResponseWriter
,
Http2StreamFrameToContainerRequestDecoder
,
Http2ContainerRequestHandlingResponseWriter
public JerseyChannelInitializer(URI baseUri, SslContext sslContext, boolean http2Support, long maxIncomingContentLength, EventExecutorGroup jerseyEventExecutorGroup, ApplicationHandler applicationHandler, int flushThreshold, AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator byteBufCreator)
JerseyChannelInitializer
.baseUri
- a URI
that will serve as the base URI
in a new
ContainerRequest
; may be null
in which case the
return value of URI.create("/")
will
be used insteadsslContext
- an SslContext
; may be null
in
which case network communications will occur in plain texthttp2Support
- if HTTP/2 support (including upgrades, prior
knowledge, h2c, etc.) should be enabledmaxIncomingContentLength
- in the case of HTTP to HTTP/2
upgrades, a long
that governs the maximum permitted
incoming entity length in bytes; if less than 0
then
Long.MAX_VALUE
will be used instead; if exactly 0
then if the HTTP message containing the upgrade header is
something like a POST
it will be rejected with a 413
error code; ignored entirely if http2Support
is
false
jerseyEventExecutorGroup
- an EventExecutorGroup
that will manage the thread on which an ApplicationHandler.handle(ContainerRequest)
call will occur; may
be null
in which case a new DefaultEventExecutorGroup
will be used insteadapplicationHandler
- 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 AbstractByteBufBackedChannelOutboundInvokingOutputStream
returned by an implementation of the AbstractContainerRequestHandlingResponseWriter.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
passed to an
AbstractContainerRequestHandlingResponseWriter
implementation; may be null
JerseyChannelInitializer(URI, SslContext, boolean, long,
EventExecutorGroup, boolean, ApplicationHandler, int,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator)
,
ContainerRequest
,
SslContext
,
HttpServerUpgradeHandler.HttpServerUpgradeHandler(SourceCodec,
UpgradeCodecFactory, int)
,
ApplicationHandler.handle(ContainerRequest)
,
AbstractContainerRequestHandlingResponseWriter
,
HttpObjectToContainerRequestDecoder
,
HttpContainerRequestHandlingResponseWriter
,
Http2StreamFrameToContainerRequestDecoder
,
Http2ContainerRequestHandlingResponseWriter
public JerseyChannelInitializer(URI baseUri, SslContext sslContext, boolean http2Support, long maxIncomingContentLength, EventExecutorGroup jerseyEventExecutorGroup, Supplier<? extends ApplicationHandler> applicationHandlerSupplier, int flushThreshold, AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator byteBufCreator)
JerseyChannelInitializer
.baseUri
- a URI
that will serve as the base URI
in a new
ContainerRequest
; may be null
in which case the
return value of URI.create("/")
will
be used insteadsslContext
- an SslContext
; may be null
in
which case network communications will occur in plain texthttp2Support
- if HTTP/2 support (including upgrades, prior
knowledge, h2c, etc.) should be enabledmaxIncomingContentLength
- in the case of HTTP to HTTP/2
upgrades, a long
that governs the maximum permitted
incoming entity length in bytes; if less than 0
then
Long.MAX_VALUE
will be used instead; if exactly 0
then if the HTTP message containing the upgrade header is
something like a POST
it will be rejected with a 413
error code; ignored entirely if http2Support
is
false
jerseyEventExecutorGroup
- an EventExecutorGroup
that will manage the thread on which an ApplicationHandler.handle(ContainerRequest)
call will occur; may
be null
in which case a new DefaultEventExecutorGroup
will be used insteadapplicationHandlerSupplier
- 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 AbstractByteBufBackedChannelOutboundInvokingOutputStream
returned by an implementation of the AbstractContainerRequestHandlingResponseWriter.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
passed to an
AbstractContainerRequestHandlingResponseWriter
implementation; may be null
JerseyChannelInitializer(URI, SslContext, boolean, long,
EventExecutorGroup, boolean, Supplier, int,
AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator)
,
ContainerRequest
,
SslContext
,
HttpServerUpgradeHandler.HttpServerUpgradeHandler(SourceCodec,
UpgradeCodecFactory, int)
,
ApplicationHandler.handle(ContainerRequest)
,
AbstractContainerRequestHandlingResponseWriter
,
HttpObjectToContainerRequestDecoder
,
HttpContainerRequestHandlingResponseWriter
,
Http2StreamFrameToContainerRequestDecoder
,
Http2ContainerRequestHandlingResponseWriter
public JerseyChannelInitializer(URI baseUri, SslContext sslContext, boolean http2Support, long maxIncomingContentLength, EventExecutorGroup jerseyEventExecutorGroup, boolean useJerseyInjection, ApplicationHandler applicationHandler, int flushThreshold, AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator byteBufCreator)
JerseyChannelInitializer
.baseUri
- a URI
that will serve as the base URI
in a new
ContainerRequest
; may be null
in which case the
return value of URI.create("/")
will
be used insteadsslContext
- an SslContext
; may be null
in
which case network communications will occur in plain texthttp2Support
- if HTTP/2 support (including upgrades, prior
knowledge, h2c, etc.) should be enabledmaxIncomingContentLength
- in the case of HTTP to HTTP/2
upgrades, a long
that governs the maximum permitted
incoming entity length in bytes; if less than 0
then
Long.MAX_VALUE
will be used instead; if exactly 0
then if the HTTP message containing the upgrade header is
something like a POST
it will be rejected with a 413
error code; ignored entirely if http2Support
is
false
jerseyEventExecutorGroup
- an EventExecutorGroup
that will manage the thread on which an ApplicationHandler.handle(ContainerRequest)
call will occur; may
be null
in which case a new DefaultEventExecutorGroup
will be used insteaduseJerseyInjection
- if true
then certain Netty
constructs like ChannelHandlerContext
will be made
available for dependency injection in user applications using
Jersey's native dependency injection facilities; if false
then these facilities will not be used or referencedapplicationHandler
- 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 AbstractByteBufBackedChannelOutboundInvokingOutputStream
returned by an implementation of the AbstractContainerRequestHandlingResponseWriter.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
passed to an
AbstractContainerRequestHandlingResponseWriter
implementation; may be null
ContainerRequest
,
SslContext
,
HttpServerUpgradeHandler.HttpServerUpgradeHandler(SourceCodec,
UpgradeCodecFactory, int)
,
ApplicationHandler.handle(ContainerRequest)
,
AbstractContainerRequestHandlingResponseWriter
,
HttpObjectToContainerRequestDecoder
,
HttpContainerRequestHandlingResponseWriter
,
Http2StreamFrameToContainerRequestDecoder
,
Http2ContainerRequestHandlingResponseWriter
public JerseyChannelInitializer(URI baseUri, SslContext sslContext, boolean http2Support, long maxIncomingContentLength, EventExecutorGroup jerseyEventExecutorGroup, boolean useJerseyInjection, Supplier<? extends ApplicationHandler> applicationHandlerSupplier, int flushThreshold, AbstractByteBufBackedChannelOutboundInvokingOutputStream.ByteBufCreator byteBufCreator)
JerseyChannelInitializer
.baseUri
- a URI
that will serve as the base URI
in a new
ContainerRequest
; may be null
in which case the
return value of URI.create("/")
will
be used insteadsslContext
- an SslContext
; may be null
in
which case network communications will occur in plain texthttp2Support
- if HTTP/2 support (including upgrades, prior
knowledge, h2c, etc.) should be enabledmaxIncomingContentLength
- in the case of HTTP to HTTP/2
upgrades, a long
that governs the maximum permitted
incoming entity length in bytes; if less than 0
then
Long.MAX_VALUE
will be used instead; if exactly 0
then if the HTTP message containing the upgrade header is
something like a POST
it will be rejected with a 413
error code; ignored entirely if http2Support
is
false
jerseyEventExecutorGroup
- an EventExecutorGroup
that will manage the thread on which an ApplicationHandler.handle(ContainerRequest)
call will occur; may
be null
in which case a new DefaultEventExecutorGroup
will be used insteaduseJerseyInjection
- if true
then certain Netty
constructs like ChannelHandlerContext
will be made
available for dependency injection in user applications using
Jersey's native dependency injection facilities; if false
then these facilities will not be used or referencedapplicationHandlerSupplier
- 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 not.flushThreshold
- the minimum number of bytes that an AbstractByteBufBackedChannelOutboundInvokingOutputStream
returned by an implementation of the AbstractContainerRequestHandlingResponseWriter.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
passed to an
AbstractContainerRequestHandlingResponseWriter
implementation; may be null
ContainerRequest
,
SslContext
,
HttpServerUpgradeHandler.HttpServerUpgradeHandler(SourceCodec,
UpgradeCodecFactory, int)
,
ApplicationHandler.handle(ContainerRequest)
,
AbstractContainerRequestHandlingResponseWriter
,
HttpObjectToContainerRequestDecoder
,
HttpContainerRequestHandlingResponseWriter
,
Http2StreamFrameToContainerRequestDecoder
,
Http2ContainerRequestHandlingResponseWriter
public final EventExecutorGroup getJerseyEventExecutorGroup()
EventExecutorGroup
that this JerseyChannelInitializer
will use to offload blocking work from
the Netty event loop.
This method never returns null
.
public final URI getBaseUri()
protected final void initChannel(Channel channel)
Channel
using an appropriate
sequencing of several ChannelHandler
s and other Netty
utility classes.
The ChannelHandler
s and other classes involved include:
HttpObjectToContainerRequestDecoder
HttpContainerRequestHandlingResponseWriter
Http2StreamFrameToContainerRequestDecoder
Http2ContainerRequestHandlingResponseWriter
HttpServerCodec
HttpServerUpgradeHandler.UpgradeCodecFactory
HttpServerUpgradeHandler.UpgradeCodec
Http2FrameCodecBuilder
Http2FrameCodec
Http2ServerUpgradeCodec
Http2MultiplexHandler
HttpServerUpgradeHandler
CleartextHttp2ServerUpgradeHandler
HttpServerExpectContinueHandler
HttpNegotiationHandler
All of these classes collaborate to form a ChannelPipeline
that can handle HTTP 1.0, HTTP 1.1 and HTTP/2
scenarios, including upgrades.
initChannel
in class ChannelInitializer<Channel>
channel
- the Channel
to initialize; must not be
null
NullPointerException
- if channel
is null
, or if the return value of channel.pipeline()
is null
protected SslHandler createSslHandler(SslContext sslContext, ByteBufAllocator byteBufAllocator)
SslHandler
when invoked.
This method never returns null
.
Overrides of this method must not return null
.
This implementation calls sslContext.newHandler(byteBufAllocator)
and returns the
result.
sslContext
- the SslContext
that may assist in the
creation; must not be null
byteBufAllocator
- a ByteBufAllocator
that may
assist in the creation; must not be null
SslHandler
; never null
NullPointerException
- if sslContext
is null
SslContext.newHandler(ByteBufAllocator)
Copyright © 2019–2020, microBean™. All rights reserved.