Class DefaultEventLoopGroupFactory
java.lang.Object
io.micronaut.http.netty.channel.DefaultEventLoopGroupFactory
- All Implemented Interfaces:
EventLoopGroupFactory
@Primary
@Singleton
public class DefaultEventLoopGroupFactory
extends Object
implements EventLoopGroupFactory
The default factory for
EventLoopGroup instances.- Since:
- 1.0
- Author:
- graemerocher
-
Field Summary
Fields inherited from interface EventLoopGroupFactory
NATIVE -
Constructor Summary
ConstructorsConstructorDescriptionDefaultEventLoopGroupFactory(NioEventLoopGroupFactory nioEventLoopGroupFactory, @Nullable EventLoopGroupFactory nativeFactory) Deprecated.DefaultEventLoopGroupFactory(NioEventLoopGroupFactory nioEventLoopGroupFactory, @Nullable EventLoopGroupFactory nativeFactory, @Nullable NettyGlobalConfiguration nettyGlobalConfiguration) Deprecated.DefaultEventLoopGroupFactory(Map<String, EventLoopGroupFactory> eventLoopGroupFactories, @Nullable NettyGlobalConfiguration nettyGlobalConfiguration) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionClass<? extends io.netty.channel.Channel> channelClass(NettyChannelType type) Returns the domain socket server channel class.Class<? extends io.netty.channel.Channel> channelClass(NettyChannelType type, @Nullable EventLoopGroupConfiguration configuration) Returns the domain socket server channel class.io.netty.channel.ChannelchannelInstance(NettyChannelType type, @Nullable EventLoopGroupConfiguration configuration) Returns the domain socket server channel class.io.netty.channel.ChannelchannelInstance(NettyChannelType type, @Nullable EventLoopGroupConfiguration configuration, @Nullable io.netty.channel.Channel parent, int fd) Returns the channel instance.io.netty.channel.EventLoopGroupcreateEventLoopGroup(int threads, @Nullable ThreadFactory threadFactory, @Nullable Integer ioRatio) Deprecated.io.netty.channel.EventLoopGroupcreateEventLoopGroup(int threads, Executor executor, @Nullable Integer ioRatio) Deprecated.io.netty.channel.EventLoopGroupcreateEventLoopGroup(EventLoopGroupConfiguration configuration, ThreadFactory threadFactory) Deprecated.io.netty.channel.IoHandlerFactoryCreate a newIoHandlerFactoryfor this transport.io.netty.channel.IoHandlerFactorycreateIoHandlerFactory(EventLoopGroupConfiguration configuration) Create a newIoHandlerFactoryfor this transport.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EventLoopGroupFactory
channelInstance, clientSocketChannelClass, clientSocketChannelInstance, createEventLoopGroup, domainServerSocketChannelClass, domainServerSocketChannelClass, domainServerSocketChannelInstance, isNative, serverSocketChannelClass, serverSocketChannelClass, serverSocketChannelInstance
-
Constructor Details
-
DefaultEventLoopGroupFactory
@Deprecated public DefaultEventLoopGroupFactory(NioEventLoopGroupFactory nioEventLoopGroupFactory, @Named("native") @Nullable EventLoopGroupFactory nativeFactory) Deprecated.Default constructor.- Parameters:
nioEventLoopGroupFactory- The NIO factorynativeFactory- The native factory if available
-
DefaultEventLoopGroupFactory
@Deprecated public DefaultEventLoopGroupFactory(NioEventLoopGroupFactory nioEventLoopGroupFactory, @Named("native") @Nullable EventLoopGroupFactory nativeFactory, @Nullable NettyGlobalConfiguration nettyGlobalConfiguration) Deprecated. -
DefaultEventLoopGroupFactory
@Inject public DefaultEventLoopGroupFactory(Map<String, EventLoopGroupFactory> eventLoopGroupFactories, @Nullable NettyGlobalConfiguration nettyGlobalConfiguration) Default constructor.- Parameters:
eventLoopGroupFactories- The available transportsnettyGlobalConfiguration- The netty global configuration
-
-
Method Details
-
createIoHandlerFactory
public io.netty.channel.IoHandlerFactory createIoHandlerFactory()Description copied from interface:EventLoopGroupFactoryCreate a newIoHandlerFactoryfor this transport.- Specified by:
createIoHandlerFactoryin interfaceEventLoopGroupFactory- Returns:
- The handler factory
-
createIoHandlerFactory
public io.netty.channel.IoHandlerFactory createIoHandlerFactory(EventLoopGroupConfiguration configuration) Description copied from interface:EventLoopGroupFactoryCreate a newIoHandlerFactoryfor this transport.- Specified by:
createIoHandlerFactoryin interfaceEventLoopGroupFactory- Parameters:
configuration- The netty configuration- Returns:
- The handler factory
-
createEventLoopGroup
@Deprecated public io.netty.channel.EventLoopGroup createEventLoopGroup(EventLoopGroupConfiguration configuration, ThreadFactory threadFactory) Deprecated.Description copied from interface:EventLoopGroupFactoryCreate an event loop group for the given configuration and thread factory.- Specified by:
createEventLoopGroupin interfaceEventLoopGroupFactory- Parameters:
configuration- The configurationthreadFactory- The thread factory- Returns:
- The event loop group
-
createEventLoopGroup
@Deprecated public io.netty.channel.EventLoopGroup createEventLoopGroup(int threads, Executor executor, @Nullable Integer ioRatio) Deprecated.Description copied from interface:EventLoopGroupFactoryCreates an EventLoopGroup.- Specified by:
createEventLoopGroupin interfaceEventLoopGroupFactory- Parameters:
threads- The number of threads to use.executor- An Executor.ioRatio- The io ratio.- Returns:
- An EventLoopGroup.
-
createEventLoopGroup
@Deprecated public io.netty.channel.EventLoopGroup createEventLoopGroup(int threads, @Nullable ThreadFactory threadFactory, @Nullable Integer ioRatio) Deprecated.Description copied from interface:EventLoopGroupFactoryCreates an EventLoopGroup.- Specified by:
createEventLoopGroupin interfaceEventLoopGroupFactory- Parameters:
threads- The number of threads to use.threadFactory- The thread factory.ioRatio- The io ratio.- Returns:
- An EventLoopGroup.
-
channelClass
public Class<? extends io.netty.channel.Channel> channelClass(NettyChannelType type) throws UnsupportedOperationException Description copied from interface:EventLoopGroupFactoryReturns the domain socket server channel class.- Specified by:
channelClassin interfaceEventLoopGroupFactory- Parameters:
type- Type of the channel to return- Returns:
- A channel class.
- Throws:
UnsupportedOperationException- if domain sockets are not supported.
-
channelClass
public Class<? extends io.netty.channel.Channel> channelClass(NettyChannelType type, @Nullable EventLoopGroupConfiguration configuration) Description copied from interface:EventLoopGroupFactoryReturns the domain socket server channel class.- Specified by:
channelClassin interfaceEventLoopGroupFactory- Parameters:
type- Type of the channel to returnconfiguration- The configuration- Returns:
- A channel implementation.
-
channelInstance
public io.netty.channel.Channel channelInstance(NettyChannelType type, @Nullable EventLoopGroupConfiguration configuration) Description copied from interface:EventLoopGroupFactoryReturns the domain socket server channel class.- Specified by:
channelInstancein interfaceEventLoopGroupFactory- Parameters:
type- Type of the channel to returnconfiguration- The configuration- Returns:
- A ServerDomainSocketChannel implementation.
-
channelInstance
public io.netty.channel.Channel channelInstance(NettyChannelType type, @Nullable EventLoopGroupConfiguration configuration, @Nullable io.netty.channel.Channel parent, int fd) Description copied from interface:EventLoopGroupFactoryReturns the channel instance.- Specified by:
channelInstancein interfaceEventLoopGroupFactory- Parameters:
type- Type of the channel to returnconfiguration- The configurationparent- Theparent channelfd- The pre-defined file descriptor- Returns:
- A channel implementation.
-