Package io.micronaut.http.netty.channel
Interface EventLoopGroupFactory
- All Known Implementing Classes:
DefaultEventLoopGroupFactory
,EpollEventLoopGroupFactory
,IoUringEventLoopGroupFactory
,KQueueEventLoopGroupFactory
,NioEventLoopGroupFactory
public interface EventLoopGroupFactory
Factory for EventLoopGroup.
- Since:
- 1.2.0
- Author:
- croudet, graemerocher
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionchannelClass
(NettyChannelType type) Returns the domain socket server channel class.channelClass
(NettyChannelType type, @Nullable EventLoopGroupConfiguration configuration) Returns the domain socket server channel class.default @NonNull io.netty.channel.Channel
channelInstance
(NettyChannelType type, @Nullable EventLoopGroupConfiguration configuration) Returns the domain socket server channel class.default @NonNull io.netty.channel.Channel
channelInstance
(NettyChannelType type, @Nullable EventLoopGroupConfiguration configuration, int fd) Returns the channel instance.clientSocketChannelClass
(@Nullable EventLoopGroupConfiguration configuration) Returns the client channel class.default @NonNull io.netty.channel.socket.SocketChannel
clientSocketChannelInstance
(@Nullable EventLoopGroupConfiguration configuration) Returns the client channel class instance.default io.netty.channel.EventLoopGroup
createEventLoopGroup
(int threads, @Nullable Integer ioRatio) Creates an EventLoopGroup.io.netty.channel.EventLoopGroup
createEventLoopGroup
(int threads, @Nullable ThreadFactory threadFactory, @Nullable Integer ioRatio) Creates an EventLoopGroup.io.netty.channel.EventLoopGroup
createEventLoopGroup
(int threads, Executor executor, @Nullable Integer ioRatio) Creates an EventLoopGroup.default io.netty.channel.EventLoopGroup
createEventLoopGroup
(EventLoopGroupConfiguration configuration, ThreadFactory threadFactory) Create an event loop group for the given configuration and thread factory.Returns the domain socket server channel class.domainServerSocketChannelClass
(@Nullable EventLoopGroupConfiguration configuration) Returns the domain socket server channel class.default @NonNull io.netty.channel.ServerChannel
Returns the domain socket server channel class.default boolean
isNative()
Returns the server channel class.serverSocketChannelClass
(@Nullable EventLoopGroupConfiguration configuration) Returns the server channel class.default @NonNull io.netty.channel.socket.ServerSocketChannel
serverSocketChannelInstance
(@Nullable EventLoopGroupConfiguration configuration) Returns the server channel class instance.
-
Field Details
-
NATIVE
Qualifier used to resolve the native factory.- See Also:
-
-
Method Details
-
isNative
default boolean isNative()- Returns:
- Is this a native factory.
-
createEventLoopGroup
io.netty.channel.EventLoopGroup createEventLoopGroup(int threads, Executor executor, @Nullable @Nullable Integer ioRatio) Creates an EventLoopGroup.- Parameters:
threads
- The number of threads to use.executor
- An Executor.ioRatio
- The io ratio.- Returns:
- An EventLoopGroup.
-
createEventLoopGroup
default io.netty.channel.EventLoopGroup createEventLoopGroup(EventLoopGroupConfiguration configuration, ThreadFactory threadFactory) Create an event loop group for the given configuration and thread factory.- Parameters:
configuration
- The configurationthreadFactory
- The thread factory- Returns:
- The event loop group
-
createEventLoopGroup
io.netty.channel.EventLoopGroup createEventLoopGroup(int threads, @Nullable @Nullable ThreadFactory threadFactory, @Nullable @Nullable Integer ioRatio) Creates an EventLoopGroup.- Parameters:
threads
- The number of threads to use.threadFactory
- The thread factory.ioRatio
- The io ratio.- Returns:
- An EventLoopGroup.
-
createEventLoopGroup
default io.netty.channel.EventLoopGroup createEventLoopGroup(int threads, @Nullable @Nullable Integer ioRatio) Creates an EventLoopGroup.- Parameters:
threads
- The number of threads to use.ioRatio
- The io ratio.- Returns:
- An EventLoopGroup.
-
serverSocketChannelClass
@NonNull @NonNull Class<? extends io.netty.channel.socket.ServerSocketChannel> serverSocketChannelClass()Returns the server channel class.- Returns:
- A ServerChannelClass.
-
domainServerSocketChannelClass
@NonNull default @NonNull Class<? extends io.netty.channel.unix.ServerDomainSocketChannel> domainServerSocketChannelClass() throws UnsupportedOperationExceptionReturns the domain socket server channel class.- Returns:
- A ServerDomainSocketChannel class.
- Throws:
UnsupportedOperationException
- if domain sockets are not supported.
-
channelClass
@NonNull default @NonNull Class<? extends io.netty.channel.Channel> channelClass(NettyChannelType type) throws UnsupportedOperationException Returns the domain socket server channel class.- Parameters:
type
- Type of the channel to return- Returns:
- A channel class.
- Throws:
UnsupportedOperationException
- if domain sockets are not supported.
-
serverSocketChannelClass
@NonNull default @NonNull Class<? extends io.netty.channel.socket.ServerSocketChannel> serverSocketChannelClass(@Nullable @Nullable EventLoopGroupConfiguration configuration) Returns the server channel class.- Parameters:
configuration
- The configuration- Returns:
- A ServerSocketChannel class.
-
domainServerSocketChannelClass
@NonNull default @NonNull Class<? extends io.netty.channel.unix.ServerDomainSocketChannel> domainServerSocketChannelClass(@Nullable @Nullable EventLoopGroupConfiguration configuration) Returns the domain socket server channel class.- Parameters:
configuration
- The configuration- Returns:
- A ServerDomainSocketChannel implementation.
- Throws:
UnsupportedOperationException
- if domain sockets are not supported.
-
channelClass
@NonNull default @NonNull Class<? extends io.netty.channel.Channel> channelClass(NettyChannelType type, @Nullable @Nullable EventLoopGroupConfiguration configuration) Returns the domain socket server channel class.- Parameters:
type
- Type of the channel to returnconfiguration
- The configuration- Returns:
- A channel implementation.
- Throws:
UnsupportedOperationException
- if domain sockets are not supported.
-
serverSocketChannelInstance
@NonNull default @NonNull io.netty.channel.socket.ServerSocketChannel serverSocketChannelInstance(@Nullable @Nullable EventLoopGroupConfiguration configuration) Returns the server channel class instance.- Parameters:
configuration
- The configuration- Returns:
- A ServerSocketChannel instance.
-
domainServerSocketChannelInstance
@NonNull default @NonNull io.netty.channel.ServerChannel domainServerSocketChannelInstance(@Nullable @Nullable EventLoopGroupConfiguration configuration) Returns the domain socket server channel class.- Parameters:
configuration
- The configuration- Returns:
- A ServerDomainSocketChannel implementation.
- Throws:
UnsupportedOperationException
- if domain sockets are not supported.
-
channelInstance
@NonNull default @NonNull io.netty.channel.Channel channelInstance(NettyChannelType type, @Nullable @Nullable EventLoopGroupConfiguration configuration) Returns the domain socket server channel class.- Parameters:
type
- Type of the channel to returnconfiguration
- The configuration- Returns:
- A ServerDomainSocketChannel implementation.
- Throws:
UnsupportedOperationException
- if domain sockets are not supported.
-
channelInstance
@NonNull default @NonNull io.netty.channel.Channel channelInstance(NettyChannelType type, @Nullable @Nullable EventLoopGroupConfiguration configuration, int fd) Returns the channel instance.- Parameters:
type
- Type of the channel to returnconfiguration
- The configurationfd
- The pre-defined file descriptor- Returns:
- A channel implementation.
- Throws:
UnsupportedOperationException
- if domain sockets are not supported.
-
clientSocketChannelClass
@NonNull @NonNull Class<? extends io.netty.channel.socket.SocketChannel> clientSocketChannelClass(@Nullable @Nullable EventLoopGroupConfiguration configuration) Returns the client channel class.- Parameters:
configuration
- The configuration- Returns:
- A SocketChannel class.
-
clientSocketChannelInstance
@NonNull default @NonNull io.netty.channel.socket.SocketChannel clientSocketChannelInstance(@Nullable @Nullable EventLoopGroupConfiguration configuration) Returns the client channel class instance.- Parameters:
configuration
- The configuration- Returns:
- A SocketChannel instance.
-