Class MicronautServletConfiguration

java.lang.Object
io.micronaut.servlet.engine.MicronautServletConfiguration
All Implemented Interfaces:
io.micronaut.core.naming.Named, ServletConfiguration

@ConfigurationProperties("micronaut.servlet") public class MicronautServletConfiguration extends Object implements io.micronaut.core.naming.Named, ServletConfiguration
Configuration properties for the Micronaut servlet.
Since:
1.0
Author:
graemerocher
  • Field Details

  • Constructor Details

    • MicronautServletConfiguration

      @ConfigurationInject public MicronautServletConfiguration(@Bindable(defaultValue="micronaut") String name, @Bindable(defaultValue="/*") String mapping, io.micronaut.http.server.HttpServerConfiguration serverConfiguration)
      Default constructor.
      Parameters:
      name - The name of the servlet
      mapping - The servlet mapping
      serverConfiguration - The http server configuration
  • Method Details

    • isAsyncSupported

      public boolean isAsyncSupported()
      Description copied from interface: ServletConfiguration
      Whether to do request processing asynchronously by default (defaults to true).
      Specified by:
      isAsyncSupported in interface ServletConfiguration
      Returns:
      True whether async is enabled
    • setAsyncSupported

      public void setAsyncSupported(boolean asyncSupported)
      Set whether async is supported or not.
      Parameters:
      asyncSupported - True if async is supported.
    • setTestAsyncSupported

      @Deprecated(forRemoval=true, since="4.8.0") @Property(name="micronaut.server.testing.async") public void setTestAsyncSupported(@Nullable @Nullable Boolean asyncSupported)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Legacy property to disable async for testing.
      Parameters:
      asyncSupported - Is async supported
    • isEnableVirtualThreads

      public boolean isEnableVirtualThreads()
      Description copied from interface: ServletConfiguration
      Whether to enable virtual thread support if available.

      If virtual threads are not available this option does nothing.

      Specified by:
      isEnableVirtualThreads in interface ServletConfiguration
      Returns:
      True if they should be enabled
    • setEnableVirtualThreads

      public void setEnableVirtualThreads(boolean enableVirtualThreads)
      Whether virtual threads are enabled.
      Parameters:
      enableVirtualThreads - True if they are enabled
      Since:
      4.8.0
    • getMapping

      public String getMapping()
      Returns:
      The servlet mapping.
    • getMultipartConfigElement

      public Optional<jakarta.servlet.MultipartConfigElement> getMultipartConfigElement()
      Returns:
      The configured multipart element if any
    • getName

      @NonNull public @NonNull String getName()
      Specified by:
      getName in interface io.micronaut.core.naming.Named
    • setAsyncFileServingEnabled

      public void setAsyncFileServingEnabled(boolean enabled)
      Is async file serving enabled.
      Parameters:
      enabled - True if it is
    • isAsyncFileServingEnabled

      public boolean isAsyncFileServingEnabled()
      Description copied from interface: ServletConfiguration
      Is async file serving enabled.
      Specified by:
      isAsyncFileServingEnabled in interface ServletConfiguration
      Returns:
      True if it is.
    • getMinThreads

      public Integer getMinThreads()
      Description copied from interface: ServletConfiguration
      Get the minimum number of threads in the created thread pool.
      Specified by:
      getMinThreads in interface ServletConfiguration
      Returns:
      The minimum number of threads
    • setMinThreads

      public void setMinThreads(Integer minThreads)
      Specify the minimum number of threads in the created thread pool.
      Parameters:
      minThreads - The minimum number of threads
    • getMaxThreads

      public Integer getMaxThreads()
      Description copied from interface: ServletConfiguration
      Get the maximum number of threads in the created thread pool.
      Specified by:
      getMaxThreads in interface ServletConfiguration
      Returns:
      The maximum number of threads
    • setMaxThreads

      public void setMaxThreads(Integer maxThreads)
      Specify the maximum number of threads in the created thread pool.
      Parameters:
      maxThreads - The maximum number of threads