Package io.micronaut.http.netty.channel
Class DefaultEventLoopGroupRegistry
- java.lang.Object
-
- io.micronaut.http.netty.channel.DefaultEventLoopGroupRegistry
-
- All Implemented Interfaces:
EventLoopGroupRegistry
@Factory @Internal public class DefaultEventLoopGroupRegistry extends java.lang.Object implements EventLoopGroupRegistry
Factory for creating named event loop groups.- Since:
- 2.0
-
-
Constructor Summary
Constructors Constructor Description DefaultEventLoopGroupRegistry(EventLoopGroupFactory eventLoopGroupFactory, io.micronaut.context.BeanLocator beanLocator)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected io.netty.channel.EventLoopGroupdefaultEventLoopGroup(java.util.concurrent.ThreadFactory threadFactory)Constructs an event loop group with default Configuration.protected io.netty.channel.EventLoopGroupeventLoopGroup(EventLoopGroupConfiguration configuration)Constructs an event loop group for each configuration.io.netty.channel.EventLoopGroupgetDefaultEventLoopGroup()java.util.Optional<io.netty.channel.EventLoopGroup>getEventLoopGroup(java.lang.String name)Obtain a configured Event Loop Group from the registry.java.util.Optional<EventLoopGroupConfiguration>getEventLoopGroupConfiguration(java.lang.String name)Obtain a configured Event Loop Group from the registry.
-
-
-
Constructor Detail
-
DefaultEventLoopGroupRegistry
public DefaultEventLoopGroupRegistry(EventLoopGroupFactory eventLoopGroupFactory, io.micronaut.context.BeanLocator beanLocator)
Default constructor.- Parameters:
eventLoopGroupFactory- The event loop group factorybeanLocator- The bean locator
-
-
Method Detail
-
eventLoopGroup
@EachBean(EventLoopGroupConfiguration.class) @Bean protected io.netty.channel.EventLoopGroup eventLoopGroup(EventLoopGroupConfiguration configuration)
Constructs an event loop group for each configuration.- Parameters:
configuration- The configuration- Returns:
- The event loop group
-
defaultEventLoopGroup
@Singleton @Requires(missingProperty="micronaut.netty.event-loops.default") @Primary @Bean(typed=io.netty.channel.EventLoopGroup.class) protected io.netty.channel.EventLoopGroup defaultEventLoopGroup(@Named("netty") java.util.concurrent.ThreadFactory threadFactory)Constructs an event loop group with default Configuration.- Parameters:
threadFactory- The default Netty thread factory- Returns:
- The event loop group
-
getDefaultEventLoopGroup
@NonNull public io.netty.channel.EventLoopGroup getDefaultEventLoopGroup()
- Specified by:
getDefaultEventLoopGroupin interfaceEventLoopGroupRegistry- Returns:
- Obtains the default event loop group.
-
getEventLoopGroup
public java.util.Optional<io.netty.channel.EventLoopGroup> getEventLoopGroup(@NonNull java.lang.String name)Description copied from interface:EventLoopGroupRegistryObtain a configured Event Loop Group from the registry.- Specified by:
getEventLoopGroupin interfaceEventLoopGroupRegistry- Parameters:
name- The name of the group- Returns:
- The event loop group if configured
-
getEventLoopGroupConfiguration
public java.util.Optional<EventLoopGroupConfiguration> getEventLoopGroupConfiguration(@NonNull java.lang.String name)
Description copied from interface:EventLoopGroupRegistryObtain a configured Event Loop Group from the registry.- Specified by:
getEventLoopGroupConfigurationin interfaceEventLoopGroupRegistry- Parameters:
name- The name of the group- Returns:
- The event loop group if configured
-
-