@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,
Application application)
Create an container of a given type.
|
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, Application application) throws ProcessingException
ContainerProvider
createContainer
in interface ContainerProvider
T
- the type of the container.type
- the type of the container.application
- JAX-RS / Jersey application.null
if the provider does not support the requested type
.ProcessingException
- if there is an error creating the container.public static io.netty.channel.Channel createServer(URI baseUri, ResourceConfig configuration, io.netty.handler.ssl.SslContext sslContext, boolean block) throws 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.ProcessingException
- when there is an issue with creating new container.public static io.netty.channel.Channel createServer(URI baseUri, ResourceConfig configuration, boolean block) throws 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.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 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
.ProcessingException
- when there is an issue with creating new container.Copyright © 2007-2017, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.