Class NettyHttpContainerProvider
- java.lang.Object
-
- org.glassfish.jersey.netty.httpserver.NettyHttpContainerProvider
-
- All Implemented Interfaces:
ContainerProvider
@Beta public class NettyHttpContainerProvider extends Object implements ContainerProvider
Netty implementation ofContainerProvider.There is also a few "factory" methods for creating Netty server.
- Since:
- 2.24
- Author:
- Pavel Bucek
-
-
Constructor Summary
Constructors Constructor Description NettyHttpContainerProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TcreateContainer(Class<T> type, Application application)static io.netty.channel.ChannelcreateHttp2Server(URI baseUri, ResourceConfig configuration, io.netty.handler.ssl.SslContext sslContext)Create and start Netty HTTP/2 server.static io.netty.channel.ChannelcreateServer(URI baseUri, org.glassfish.jersey.netty.httpserver.NettyHttpContainer container, io.netty.handler.ssl.SslContext sslContext, boolean block)Create and start Netty server.static io.netty.channel.ChannelcreateServer(URI baseUri, ResourceConfig configuration, boolean block)Create and start Netty server.static io.netty.channel.ChannelcreateServer(URI baseUri, ResourceConfig configuration, io.netty.handler.ssl.SslContext sslContext, boolean block)Create and start Netty server.
-
-
-
Method Detail
-
createContainer
public <T> T createContainer(Class<T> type, Application application) throws ProcessingException
- Specified by:
createContainerin interfaceContainerProvider- Throws:
ProcessingException
-
createServer
public static io.netty.channel.Channel createServer(URI baseUri, org.glassfish.jersey.netty.httpserver.NettyHttpContainer container, io.netty.handler.ssl.SslContext sslContext, boolean block) throws ProcessingException
Create and start Netty server.- Parameters:
baseUri- base uri.container- Jersey container.sslContext- Netty SSL context (can be null).block- whentrue, this method will block until the server is stopped. Whenfalse, the execution will end immediately after the server is started.- Returns:
- Netty channel instance.
- Throws:
ProcessingException- when there is an issue with creating new container.
-
createServer
public static io.netty.channel.Channel createServer(URI baseUri, ResourceConfig configuration, io.netty.handler.ssl.SslContext sslContext, boolean block) throws ProcessingException
Create and start Netty server.- Parameters:
baseUri- base uri.configuration- Jersey configuration.sslContext- Netty SSL context (can be null).block- whentrue, this method will block until the server is stopped. Whenfalse, the execution will end immediately after the server is started.- Returns:
- Netty channel instance.
- Throws:
ProcessingException- when there is an issue with creating new container.
-
createServer
public static io.netty.channel.Channel createServer(URI baseUri, ResourceConfig configuration, boolean block) throws ProcessingException
Create and start Netty server.- Parameters:
baseUri- base uri.configuration- Jersey configuration.block- whentrue, this method will block until the server is stopped. Whenfalse, the execution will end immediately after the server is started.- Returns:
- Netty channel instance.
- Throws:
ProcessingException- when there is an issue with creating new container.
-
createHttp2Server
public static io.netty.channel.Channel createHttp2Server(URI baseUri, ResourceConfig configuration, io.netty.handler.ssl.SslContext sslContext) throws ProcessingException
Create and start Netty HTTP/2 server.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.
- Parameters:
baseUri- base uri.configuration- Jersey configuration.sslContext- NettySslContext.- Returns:
- Netty channel instance.
- Throws:
ProcessingException- when there is an issue with creating new container.
-
-