Class DefaultEventLoopGroupRegistry

java.lang.Object
io.micronaut.http.netty.channel.DefaultEventLoopGroupRegistry
All Implemented Interfaces:
EventLoopGroupRegistry

@Factory @Internal public class DefaultEventLoopGroupRegistry extends Object implements EventLoopGroupRegistry
Factory for creating named event loop groups.
Since:
2.0
  • Constructor Details

    • DefaultEventLoopGroupRegistry

      public DefaultEventLoopGroupRegistry(EventLoopGroupFactory eventLoopGroupFactory, io.micronaut.context.BeanLocator beanLocator)
      Default constructor.
      Parameters:
      eventLoopGroupFactory - The event loop group factory
      beanLocator - The bean locator
  • Method Details

    • 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") 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 @NonNull io.netty.channel.EventLoopGroup getDefaultEventLoopGroup()
      Specified by:
      getDefaultEventLoopGroup in interface EventLoopGroupRegistry
      Returns:
      Obtains the default event loop group.
    • getEventLoopGroup

      public Optional<io.netty.channel.EventLoopGroup> getEventLoopGroup(@NonNull @NonNull String name)
      Description copied from interface: EventLoopGroupRegistry
      Obtain a configured Event Loop Group from the registry.
      Specified by:
      getEventLoopGroup in interface EventLoopGroupRegistry
      Parameters:
      name - The name of the group
      Returns:
      The event loop group if configured
    • getEventLoopGroupConfiguration

      public Optional<EventLoopGroupConfiguration> getEventLoopGroupConfiguration(@NonNull @NonNull String name)
      Description copied from interface: EventLoopGroupRegistry
      Obtain a configured Event Loop Group from the registry.
      Specified by:
      getEventLoopGroupConfiguration in interface EventLoopGroupRegistry
      Parameters:
      name - The name of the group
      Returns:
      The event loop group if configured