Class NettyJaxrsServer
java.lang.Object
org.jboss.resteasy.plugins.server.netty.NettyJaxrsServer
- All Implemented Interfaces:
EmbeddedJaxrsServer<NettyJaxrsServer>
,EmbeddedServer
- Direct Known Subclasses:
CdiNettyJaxrsServer
An HTTP server that sends back the content of the received HTTP request
in a pretty plaintext form.
- Version:
- $Rev: 2080 $, $Date: 2010-01-26 18:04:19 +0900 (Tue, 26 Jan 2010) $
- Author:
- The Netty Project, Andy Taylor (andy.taylor@jboss.org), Trustin Lee, Norman Maurer
-
Field Summary
Modifier and TypeFieldDescriptionprotected io.netty.bootstrap.ServerBootstrap
protected int
protected ResteasyDeployment
protected SecurityDomain
protected String
protected String
protected int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected RequestDispatcher
deploy()
Returns the deployment being used for the server.int
int
getPort()
setBacklog
(int backlog) setChannelHandlers
(List<io.netty.channel.ChannelHandler> channelHandlers) Add additionalChannelHandler
s to theServerBootstrap
.setChannelOptions
(Map<io.netty.channel.ChannelOption, Object> channelOptions) Add NettyChannelOption
s to theServerBootstrap
.setChildChannelOptions
(Map<io.netty.channel.ChannelOption, Object> channelOptions) Add child options to theServerBootstrap
.setDeployment
(ResteasyDeployment deployment) setExecutorThreadCount
(int executorThreadCount) Set the number of threads to use for the EventExecutor.setHostname
(String hostname) setHttpChannelHandlers
(List<io.netty.channel.ChannelHandler> httpChannelHandlers) Add additionalChannelHandler
s to theServerBootstrap
.setIdleTimeout
(int idleTimeoutSeconds) Set the idle timeout.setIoWorkerCount
(int ioWorkerCount) Specify the worker count to use.setMaxChunkSize
(int maxChunkSize) setMaxHeaderSize
(int maxHeaderSize) setMaxInitialLineLength
(int maxInitialLineLength) setMaxRequestSize
(int maxRequestSize) Set the max.setPort
(int port) setRootResourcePath
(String rootResourcePath) setSniConfiguration
(SniConfiguration sniConfiguration) setSSLContext
(SSLContext sslContext) start()
void
start
(jakarta.ws.rs.SeBootstrap.Configuration configuration) Starts the server synchronously.void
stop()
Stops the server.
-
Field Details
-
bootstrap
protected io.netty.bootstrap.ServerBootstrap bootstrap -
hostname
-
configuredPort
protected int configuredPort -
runtimePort
protected int runtimePort -
deployment
-
root
-
domain
-
-
Constructor Details
-
NettyJaxrsServer
public NettyJaxrsServer()
-
-
Method Details
-
deploy
- Specified by:
deploy
in interfaceEmbeddedJaxrsServer<NettyJaxrsServer>
-
start
- Specified by:
start
in interfaceEmbeddedJaxrsServer<NettyJaxrsServer>
-
start
public void start(jakarta.ws.rs.SeBootstrap.Configuration configuration) Description copied from interface:EmbeddedServer
Starts the server synchronously.- Specified by:
start
in interfaceEmbeddedJaxrsServer<NettyJaxrsServer>
- Specified by:
start
in interfaceEmbeddedServer
- Parameters:
configuration
- the configuration used to configure the server
-
stop
public void stop()Description copied from interface:EmbeddedServer
Stops the server.- Specified by:
stop
in interfaceEmbeddedServer
-
getDeployment
Description copied from interface:EmbeddedServer
Returns the deployment being used for the server.- Specified by:
getDeployment
in interfaceEmbeddedServer
- Returns:
- the deployment
-
setDeployment
- Specified by:
setDeployment
in interfaceEmbeddedJaxrsServer<NettyJaxrsServer>
-
setPort
- Specified by:
setPort
in interfaceEmbeddedJaxrsServer<NettyJaxrsServer>
-
getPort
public int getPort() -
setHostname
- Specified by:
setHostname
in interfaceEmbeddedJaxrsServer<NettyJaxrsServer>
-
getHostname
-
setRootResourcePath
- Specified by:
setRootResourcePath
in interfaceEmbeddedJaxrsServer<NettyJaxrsServer>
-
setSecurityDomain
- Specified by:
setSecurityDomain
in interfaceEmbeddedJaxrsServer<NettyJaxrsServer>
-
setSSLContext
-
setSniConfiguration
-
getSniConfiguration
-
setIoWorkerCount
Specify the worker count to use. For more information about this please see the javadocs ofEventLoopGroup
- Parameters:
ioWorkerCount
- worker count
-
setExecutorThreadCount
Set the number of threads to use for the EventExecutor. For more information please see the javadocs ofEventExecutor
. If you want to disable the use of theEventExecutor
specify a value <= 0. This should only be done if you are 100% sure that you don't have any blocking code in there.- Parameters:
executorThreadCount
- thread count
-
setMaxRequestSize
Set the max. request size in bytes. If this size is exceed we will send a "413 Request Entity Too Large" to the client.- Parameters:
maxRequestSize
- the max request size. This is 10mb by default.
-
setMaxInitialLineLength
-
setMaxHeaderSize
-
setMaxChunkSize
-
setBacklog
-
getIdleTimeout
public int getIdleTimeout() -
setIdleTimeout
Set the idle timeout. Set this value to turn on idle connection cleanup. If there is no traffic within idleTimeoutSeconds, it'll close connection.- Parameters:
idleTimeoutSeconds
- - How many seconds to cleanup client connection. default value -1 meaning no idle timeout.
-
setChannelHandlers
Add additionalChannelHandler
s to theServerBootstrap
.The additional channel handlers are being added before the HTTP handling.
- Parameters:
channelHandlers
- the additionalChannelHandler
s.
-
setHttpChannelHandlers
public NettyJaxrsServer setHttpChannelHandlers(List<io.netty.channel.ChannelHandler> httpChannelHandlers) Add additionalChannelHandler
s to theServerBootstrap
.The additional channel handlers are being added after the HTTP handling.
- Parameters:
httpChannelHandlers
- the additionalChannelHandler
s.
-
setChannelOptions
public NettyJaxrsServer setChannelOptions(Map<io.netty.channel.ChannelOption, Object> channelOptions) Add NettyChannelOption
s to theServerBootstrap
.- Parameters:
channelOptions
- the additionalChannelOption
s.- See Also:
-
setChildChannelOptions
public NettyJaxrsServer setChildChannelOptions(Map<io.netty.channel.ChannelOption, Object> channelOptions) Add child options to theServerBootstrap
.- Parameters:
channelOptions
- the additional childChannelOption
s.- See Also:
-
createRequestDispatcher
-