Package io.micronaut.http.server.netty
Interface NettyEmbeddedServer
- All Superinterfaces:
ApplicationContextLifeCycle<EmbeddedServer>
,ApplicationContextProvider
,ApplicationEventListener<RefreshEvent>
,AutoCloseable
,ChannelPipelineCustomizer
,Closeable
,EmbeddedApplication<EmbeddedServer>
,EmbeddedServer
,EventListener
,LifeCycle
,NettyServerCustomizer.Registry
,Ordered
,RefreshEventListener
,WebSocketSessionRepository
- All Known Implementing Classes:
NettyHttpServer
public interface NettyEmbeddedServer
extends EmbeddedServer, WebSocketSessionRepository, ChannelPipelineCustomizer, RefreshEventListener, NettyServerCustomizer.Registry
Extended
EmbeddedServer
interface that represents a
Netty-based HTTP server.- Since:
- 3.1.0
- Author:
- graemerocher
-
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_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_UPGRADE
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
Fields 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 void
register
(@NonNull NettyServerCustomizer customizer) Register a new customizer with this server.default @NonNull NettyEmbeddedServer
start()
Starts the lifecyle component.default @NonNull NettyEmbeddedServer
stop()
Stops the life cycle component.Stops the Netty instance, but keeps the ApplicationContext running.Methods inherited from interface io.micronaut.context.event.ApplicationEventListener
onApplicationEvent
Methods inherited from interface io.micronaut.http.netty.channel.ChannelPipelineCustomizer
doOnConnect, isClientChannel, isServerChannel
Methods inherited from interface io.micronaut.runtime.EmbeddedApplication
getApplicationConfiguration, getApplicationContext, getEnvironment, isForceExit
Methods inherited from interface io.micronaut.runtime.server.EmbeddedServer
getContextURI, getHost, getPort, getScheme, getURI, getURL, isKeepAlive, isServer
Methods inherited from interface io.micronaut.runtime.context.scope.refresh.RefreshEventListener
getObservedConfigurationPrefixes, getOrder, supports
Methods 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
Description copied from interface:LifeCycle
Starts the lifecyle component.- Specified by:
start
in interfaceApplicationContextLifeCycle<EmbeddedServer>
- Specified by:
start
in interfaceLifeCycle
- Returns:
- This lifecycle component
-
stop
Description copied from interface:LifeCycle
Stops the life cycle component.- Specified by:
stop
in interfaceApplicationContextLifeCycle<EmbeddedServer>
- Specified by:
stop
in interfaceLifeCycle
- Returns:
- This lifecycle component
-
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.Registry
Register 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:
register
in interfaceNettyServerCustomizer.Registry
- Parameters:
customizer
- The customizer to register.
-