Package io.micronaut.http.server.netty
Interface NettyEmbeddedServer
- All Superinterfaces:
io.micronaut.context.ApplicationContextLifeCycle<io.micronaut.runtime.server.EmbeddedServer>,io.micronaut.context.ApplicationContextProvider,io.micronaut.context.event.ApplicationEventListener<io.micronaut.runtime.context.scope.refresh.RefreshEvent>,AutoCloseable,io.micronaut.http.netty.channel.ChannelPipelineCustomizer,Closeable,io.micronaut.runtime.EmbeddedApplication<io.micronaut.runtime.server.EmbeddedServer>,io.micronaut.runtime.server.EmbeddedServer,EventListener,io.micronaut.context.LifeCycle,NettyServerCustomizer.Registry,io.micronaut.core.order.Ordered,io.micronaut.runtime.context.scope.refresh.RefreshEventListener,io.micronaut.http.netty.websocket.WebSocketSessionRepository
- All Known Implementing Classes:
NettyHttpServer
public interface NettyEmbeddedServer
extends io.micronaut.runtime.server.EmbeddedServer, io.micronaut.http.netty.websocket.WebSocketSessionRepository, io.micronaut.http.netty.channel.ChannelPipelineCustomizer, io.micronaut.runtime.context.scope.refresh.RefreshEventListener, NettyServerCustomizer.Registry
Extended
EmbeddedServer interface that represents a
Netty-based HTTP server.- Since:
- 3.1.0
-
Field Summary
Fields inherited from interface io.micronaut.http.netty.channel.ChannelPipelineCustomizer
HANDLER_ACCESS_LOGGER, HANDLER_ACTIVITY_LISTENER, 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_PING_SENDER, HANDLER_HTTP2_PROTOCOL_NEGOTIATOR, HANDLER_HTTP2_SETTINGS, HANDLER_HTTP2_UPGRADE_REQUEST, HANDLER_IDLE_STATE, HANDLER_INITIAL_ERROR, HANDLER_MICRONAUT_FULL_HTTP_RESPONSE, HANDLER_MICRONAUT_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_UPGRADEFields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEFields inherited from interface io.micronaut.runtime.context.scope.refresh.RefreshEventListener
DEFAULT_POSITION -
Method Summary
Modifier and TypeMethodDescriptionGets the set of all ports this Netty server is bound to.default voidregister(@NonNull NettyServerCustomizer customizer) Register a new customizer with this server.default @NonNull NettyEmbeddedServerstart()default @NonNull NettyEmbeddedServerstop()@NonNull NettyEmbeddedServerStops the Netty instance, but keeps the ApplicationContext running.Methods inherited from interface io.micronaut.context.event.ApplicationEventListener
onApplicationEventMethods inherited from interface io.micronaut.http.netty.channel.ChannelPipelineCustomizer
doOnConnect, isClientChannel, isServerChannelMethods inherited from interface io.micronaut.runtime.EmbeddedApplication
getApplicationConfiguration, getApplicationContext, getEnvironment, isForceExitMethods inherited from interface io.micronaut.runtime.server.EmbeddedServer
getContextURI, getHost, getPort, getScheme, getURI, getURL, isKeepAlive, isServerMethods inherited from interface io.micronaut.context.LifeCycle
close, isRunning, refreshMethods inherited from interface io.micronaut.runtime.context.scope.refresh.RefreshEventListener
getObservedConfigurationPrefixes, getOrder, supportsMethods inherited from interface io.micronaut.http.netty.websocket.WebSocketSessionRepository
addChannel, getChannelGroup, removeChannel
-
Method Details
-
getBoundPorts
Gets the set of all ports this Netty server is bound to.- Returns:
- An immutable set of bound ports if the server has been started with
start()an empty set otherwise.
-
start
- Specified by:
startin interfaceio.micronaut.context.ApplicationContextLifeCycle<io.micronaut.runtime.server.EmbeddedServer>- Specified by:
startin interfaceio.micronaut.context.LifeCycle
-
stop
- Specified by:
stopin interfaceio.micronaut.context.ApplicationContextLifeCycle<io.micronaut.runtime.server.EmbeddedServer>- Specified by:
stopin interfaceio.micronaut.context.LifeCycle
-
stopServerOnly
Stops the Netty instance, but keeps the ApplicationContext running. This for CRaC checkpointing purposes. This method will only return after waiting for netty to stop.- Returns:
- The stopped NettyEmbeddedServer
-
register
Description copied from interface:NettyServerCustomizer.RegistryRegister a new customizer with this server. Note that this method must be called before the server is started: When a listener launches, it may only respect the customizers that were registered at the time, and ignore future additions.- Specified by:
registerin interfaceNettyServerCustomizer.Registry- Parameters:
customizer- The customizer to register.
-