@Beta public class NettyHttpContainerProvider extends Object implements ContainerProvider
ContainerProvider.
There is also a few "factory" methods for creating Netty server.
| Constructor and Description |
|---|
NettyHttpContainerProvider() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
createContainer(Class<T> type,
javax.ws.rs.core.Application application) |
static io.netty.channel.Channel |
createHttp2Server(URI baseUri,
ResourceConfig configuration,
io.netty.handler.ssl.SslContext sslContext)
Create and start Netty HTTP/2 server.
|
static io.netty.channel.Channel |
createServer(URI baseUri,
ResourceConfig configuration,
boolean block)
Create and start Netty server.
|
static io.netty.channel.Channel |
createServer(URI baseUri,
ResourceConfig configuration,
io.netty.handler.ssl.SslContext sslContext,
boolean block)
Create and start Netty server.
|
public <T> T createContainer(Class<T> type, javax.ws.rs.core.Application application) throws javax.ws.rs.ProcessingException
createContainer in interface ContainerProviderjavax.ws.rs.ProcessingExceptionpublic static io.netty.channel.Channel createServer(URI baseUri, ResourceConfig configuration, io.netty.handler.ssl.SslContext sslContext, boolean block) throws javax.ws.rs.ProcessingException
baseUri - base uri.configuration - Jersey configuration.sslContext - Netty SSL context (can be null).block - when true, this method will block until the server is stopped. When false, the
execution will
end immediately after the server is started.javax.ws.rs.ProcessingException - when there is an issue with creating new container.public static io.netty.channel.Channel createServer(URI baseUri, ResourceConfig configuration, boolean block) throws javax.ws.rs.ProcessingException
baseUri - base uri.configuration - Jersey configuration.block - when true, this method will block until the server is stopped. When false, the
execution will
end immediately after the server is started.javax.ws.rs.ProcessingException - when there is an issue with creating new container.public static io.netty.channel.Channel createHttp2Server(URI baseUri, ResourceConfig configuration, io.netty.handler.ssl.SslContext sslContext) throws javax.ws.rs.ProcessingException
The server is capable of connection upgrade to HTTP/2. HTTP/1.x request will be server as they were used to.
Note that this implementation cannot be more experimental. Any contributions / feedback is welcomed.
baseUri - base uri.configuration - Jersey configuration.sslContext - Netty SslContext.javax.ws.rs.ProcessingException - when there is an issue with creating new container.Copyright © 2007-2021, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.