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_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 Type
    Method
    Description
    default Set<Integer>
    Gets 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
     
    default @NonNull NettyEmbeddedServer
     
    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.context.LifeCycle

    close, isRunning, refresh

    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

      default Set<Integer> 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

      @NonNull default @NonNull NettyEmbeddedServer start()
      Specified by:
      start in interface io.micronaut.context.ApplicationContextLifeCycle<io.micronaut.runtime.server.EmbeddedServer>
      Specified by:
      start in interface io.micronaut.context.LifeCycle
    • stop

      @NonNull default @NonNull NettyEmbeddedServer stop()
      Specified by:
      stop in interface io.micronaut.context.ApplicationContextLifeCycle<io.micronaut.runtime.server.EmbeddedServer>
      Specified by:
      stop in interface io.micronaut.context.LifeCycle
    • stopServerOnly

      @NonNull @NonNull NettyEmbeddedServer 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

      default void register(@NonNull @NonNull NettyServerCustomizer customizer)
      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 interface NettyServerCustomizer.Registry
      Parameters:
      customizer - The customizer to register.