@Internal public class NettyHttpServer extends java.lang.Object implements NettyEmbeddedServer
EmbeddedServer.RoutingInBoundHandler| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
OUTBOUND_KEY |
HANDLER_ACCESS_LOGGER, HANDLER_CONNECT_TTL, HANDLER_FLOW_CONTROL, HANDLER_HTTP_AGGREGATOR, HANDLER_HTTP_CHUNK, HANDLER_HTTP_CLIENT_CODEC, HANDLER_HTTP_CLIENT_INIT, HANDLER_HTTP_COMPRESSOR, HANDLER_HTTP_DECODER, HANDLER_HTTP_DECOMPRESSOR, HANDLER_HTTP_KEEP_ALIVE, HANDLER_HTTP_PROXY, HANDLER_HTTP_SERVER_CODEC, HANDLER_HTTP_STREAM, HANDLER_HTTP_TO_HTTPS_REDIRECT, HANDLER_HTTP2_CONNECTION, HANDLER_HTTP2_PROTOCOL_NEGOTIATOR, HANDLER_HTTP2_SETTINGS, HANDLER_HTTP2_UPGRADE_REQUEST, HANDLER_IDLE_STATE, HANDLER_MICRONAUT_FULL_HTTP_RESPONSE, HANDLER_MICRONAUT_HTTP_RESPONSE_FULL, HANDLER_MICRONAUT_HTTP_RESPONSE_STREAM, HANDLER_MICRONAUT_INBOUND, HANDLER_MICRONAUT_SSE_CONTENT, HANDLER_MICRONAUT_SSE_EVENT_STREAM, HANDLER_MICRONAUT_WEBSOCKET_CLIENT, HANDLER_READ_TIMEOUT, HANDLER_SOCKS_5_PROXY, HANDLER_SSL, HANDLER_WEBSOCKET_UPGRADE| Constructor and Description |
|---|
NettyHttpServer(NettyHttpServerConfiguration serverConfiguration,
NettyEmbeddedServices nettyEmbeddedServices,
NettyCustomizableResponseTypeHandlerRegistry handlerRegistry,
boolean isDefault) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChannel(io.netty.channel.Channel channel) |
protected io.netty.channel.EventLoopGroup |
createParentEventLoopGroup() |
protected io.netty.bootstrap.ServerBootstrap |
createServerBootstrap() |
protected io.netty.channel.EventLoopGroup |
createWorkerEventLoopGroup(io.micronaut.http.netty.channel.EventLoopGroupConfiguration workerConfig) |
void |
doOnConnect(io.micronaut.http.netty.channel.ChannelPipelineListener listener) |
io.micronaut.runtime.ApplicationConfiguration |
getApplicationConfiguration() |
io.micronaut.context.ApplicationContext |
getApplicationContext() |
java.util.Set<java.lang.Integer> |
getBoundPorts()
Gets the set of all ports this Netty server is bound to.
|
io.netty.channel.group.ChannelGroup |
getChannelGroup() |
java.lang.String |
getHost() |
java.util.Set<java.lang.String> |
getObservedConfigurationPrefixes() |
int |
getPort() |
java.lang.String |
getScheme() |
NettyHttpServerConfiguration |
getServerConfiguration() |
java.net.URI |
getURI() |
java.net.URL |
getURL() |
io.micronaut.http.netty.websocket.WebSocketSessionRepository |
getWebSocketSessionRepository() |
boolean |
isClientChannel() |
boolean |
isKeepAlive() |
boolean |
isRunning() |
void |
onApplicationEvent(io.micronaut.runtime.context.scope.refresh.RefreshEvent event) |
void |
removeChannel(io.netty.channel.Channel channel) |
NettyEmbeddedServer |
start() |
NettyEmbeddedServer |
stop() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEnvironment, isForceExitpublic static final java.lang.String OUTBOUND_KEY
public NettyHttpServer(NettyHttpServerConfiguration serverConfiguration, NettyEmbeddedServices nettyEmbeddedServices, NettyCustomizableResponseTypeHandlerRegistry handlerRegistry, boolean isDefault)
serverConfiguration - The Netty HTTP server configurationnettyEmbeddedServices - The embedded server contexthandlerRegistry - The handler registryisDefault - Is this the default serverpublic boolean isKeepAlive()
isKeepAlive in interface io.micronaut.runtime.server.EmbeddedServerpublic NettyHttpServerConfiguration getServerConfiguration()
public boolean isRunning()
isRunning in interface io.micronaut.context.LifeCyclepublic NettyEmbeddedServer start()
start in interface io.micronaut.context.ApplicationContextLifeCycle<io.micronaut.runtime.server.EmbeddedServer>start in interface io.micronaut.context.LifeCyclestart in interface NettyEmbeddedServerpublic NettyEmbeddedServer stop()
stop in interface io.micronaut.context.ApplicationContextLifeCycle<io.micronaut.runtime.server.EmbeddedServer>stop in interface io.micronaut.context.LifeCyclestop in interface NettyEmbeddedServerpublic int getPort()
getPort in interface io.micronaut.runtime.server.EmbeddedServerpublic java.lang.String getHost()
getHost in interface io.micronaut.runtime.server.EmbeddedServerpublic java.lang.String getScheme()
getScheme in interface io.micronaut.runtime.server.EmbeddedServerpublic java.net.URL getURL()
getURL in interface io.micronaut.runtime.server.EmbeddedServerpublic java.net.URI getURI()
getURI in interface io.micronaut.runtime.server.EmbeddedServerpublic io.micronaut.context.ApplicationContext getApplicationContext()
getApplicationContext in interface io.micronaut.context.ApplicationContextProvidergetApplicationContext in interface io.micronaut.runtime.EmbeddedApplication<io.micronaut.runtime.server.EmbeddedServer>public io.micronaut.runtime.ApplicationConfiguration getApplicationConfiguration()
getApplicationConfiguration in interface io.micronaut.runtime.EmbeddedApplication<io.micronaut.runtime.server.EmbeddedServer>public final java.util.Set<java.lang.Integer> getBoundPorts()
NettyEmbeddedServergetBoundPorts in interface NettyEmbeddedServerNettyEmbeddedServer.start() an empty set otherwise.protected io.netty.channel.EventLoopGroup createParentEventLoopGroup()
protected io.netty.channel.EventLoopGroup createWorkerEventLoopGroup(@Nullable
io.micronaut.http.netty.channel.EventLoopGroupConfiguration workerConfig)
workerConfig - The worker configurationprotected io.netty.bootstrap.ServerBootstrap createServerBootstrap()
public void addChannel(io.netty.channel.Channel channel)
addChannel in interface io.micronaut.http.netty.websocket.WebSocketSessionRepositorypublic void removeChannel(io.netty.channel.Channel channel)
removeChannel in interface io.micronaut.http.netty.websocket.WebSocketSessionRepositorypublic io.netty.channel.group.ChannelGroup getChannelGroup()
getChannelGroup in interface io.micronaut.http.netty.websocket.WebSocketSessionRepositorypublic io.micronaut.http.netty.websocket.WebSocketSessionRepository getWebSocketSessionRepository()
NettyHttpServer which implements WebSocketSessionRepositorypublic boolean isClientChannel()
isClientChannel in interface io.micronaut.http.netty.channel.ChannelPipelineCustomizerpublic void doOnConnect(@NonNull
io.micronaut.http.netty.channel.ChannelPipelineListener listener)
doOnConnect in interface io.micronaut.http.netty.channel.ChannelPipelineCustomizerpublic java.util.Set<java.lang.String> getObservedConfigurationPrefixes()
getObservedConfigurationPrefixes in interface io.micronaut.runtime.context.scope.refresh.RefreshEventListenerpublic void onApplicationEvent(io.micronaut.runtime.context.scope.refresh.RefreshEvent event)
onApplicationEvent in interface io.micronaut.context.event.ApplicationEventListener<io.micronaut.runtime.context.scope.refresh.RefreshEvent>