Package io.micronaut.servlet.engine
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 SummaryFieldsFields inherited from interface io.micronaut.servlet.http.ServletConfigurationDEFAULT
- 
Constructor SummaryConstructorsConstructorDescriptionMicronautServletConfiguration(String name, String mapping, io.micronaut.http.server.HttpServerConfiguration serverConfiguration) Default constructor.
- 
Method SummaryModifier and TypeMethodDescriptionGet the maximum number of threads in the created thread pool.Get the minimum number of threads in the created thread pool.Optional<jakarta.servlet.MultipartConfigElement>@NonNull StringgetName()booleanIs async file serving enabled.booleanWhether to do request processing asynchronously by default (defaults totrue).booleanWhether to enable virtual thread support if available.voidsetAsyncFileServingEnabled(boolean enabled) Is async file serving enabled.voidsetAsyncSupported(boolean asyncSupported) Set whether async is supported or not.voidsetEnableVirtualThreads(boolean enableVirtualThreads) Whether virtual threads are enabled.voidsetMaxThreads(Integer maxThreads) Specify the maximum number of threads in the created thread pool.voidsetMinThreads(Integer minThreads) Specify the minimum number of threads in the created thread pool.voidsetTestAsyncSupported(@Nullable Boolean asyncSupported) Deprecated, for removal: This API element is subject to removal in a future version.
- 
Field Details- 
PREFIXThe prefix used for configuration.- See Also:
 
 
- 
- 
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- 
isAsyncSupportedpublic boolean isAsyncSupported()Description copied from interface:ServletConfigurationWhether to do request processing asynchronously by default (defaults totrue).- Specified by:
- isAsyncSupportedin interface- ServletConfiguration
- Returns:
- True whether async is enabled
 
- 
setAsyncSupportedpublic 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.UsesetAsyncSupported(boolean)insteadLegacy property to disable async for testing.- Parameters:
- asyncSupported- Is async supported
 
- 
isEnableVirtualThreadspublic boolean isEnableVirtualThreads()Description copied from interface:ServletConfigurationWhether to enable virtual thread support if available.If virtual threads are not available this option does nothing. - Specified by:
- isEnableVirtualThreadsin interface- ServletConfiguration
- Returns:
- True if they should be enabled
 
- 
setEnableVirtualThreadspublic void setEnableVirtualThreads(boolean enableVirtualThreads) Whether virtual threads are enabled.- Parameters:
- enableVirtualThreads- True if they are enabled
- Since:
- 4.8.0
 
- 
getMapping- Returns:
- The servlet mapping.
 
- 
getMultipartConfigElement- Returns:
- The configured multipart element if any
 
- 
getName- Specified by:
- getNamein interface- io.micronaut.core.naming.Named
 
- 
setAsyncFileServingEnabledpublic void setAsyncFileServingEnabled(boolean enabled) Is async file serving enabled.- Parameters:
- enabled- True if it is
 
- 
isAsyncFileServingEnabledpublic boolean isAsyncFileServingEnabled()Description copied from interface:ServletConfigurationIs async file serving enabled.- Specified by:
- isAsyncFileServingEnabledin interface- ServletConfiguration
- Returns:
- True if it is.
 
- 
getMinThreadsDescription copied from interface:ServletConfigurationGet the minimum number of threads in the created thread pool.- Specified by:
- getMinThreadsin interface- ServletConfiguration
- Returns:
- The minimum number of threads
 
- 
setMinThreadsSpecify the minimum number of threads in the created thread pool.- Parameters:
- minThreads- The minimum number of threads
 
- 
getMaxThreadsDescription copied from interface:ServletConfigurationGet the maximum number of threads in the created thread pool.- Specified by:
- getMaxThreadsin interface- ServletConfiguration
- Returns:
- The maximum number of threads
 
- 
setMaxThreadsSpecify the maximum number of threads in the created thread pool.- Parameters:
- maxThreads- The maximum number of threads
 
 
- 
setAsyncSupported(boolean)instead