Class SdkEventLoopGroup
- java.lang.Object
-
- software.amazon.awssdk.http.nio.netty.SdkEventLoopGroup
-
public final class SdkEventLoopGroup extends Object
ProvidesEventLoopGroupandChannelFactoryforNettyNioAsyncHttpClient.There are three ways to create a new instance.
- using
builder()to provide custom configuration ofEventLoopGroup. This is the preferred configuration method when you just want to customize theEventLoopGroup - Using
create(EventLoopGroup)to provide a customEventLoopGroup.ChannelFactorywill be resolved based on the type ofEventLoopGroupprovided viaChannelResolver.resolveSocketChannelFactory(EventLoopGroup)andChannelResolver.resolveDatagramChannelFactory(EventLoopGroup) - Using
create(EventLoopGroup, ChannelFactory)to provide a customEventLoopGroupandChannelFactory
When configuring the
EventLoopGroupofNettyNioAsyncHttpClient, ifSdkEventLoopGroup.Builderis passed toNettyNioAsyncHttpClient.Builder.eventLoopGroupBuilder(software.amazon.awssdk.http.nio.netty.SdkEventLoopGroup.Builder), theEventLoopGroupis managed by the SDK and will be shutdown when the HTTP client is closed. Otherwise, if an instance ofSdkEventLoopGroupis passed toNettyNioAsyncHttpClient.Builder.eventLoopGroup(software.amazon.awssdk.http.nio.netty.SdkEventLoopGroup), theEventLoopGroupMUST be closed by the caller when it is ready to be disposed. The SDK will not close theEventLoopGroupwhen the HTTP client is closed. SeeEventExecutorGroup.shutdownGracefully()to properly close the event loop group. - using
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSdkEventLoopGroup.BuilderA builder forSdkEventLoopGroup.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SdkEventLoopGroup.Builderbuilder()io.netty.channel.ChannelFactory<? extends io.netty.channel.Channel>channelFactory()static SdkEventLoopGroupcreate(io.netty.channel.EventLoopGroup eventLoopGroup)Creates a new instance of SdkEventLoopGroup withEventLoopGroup.static SdkEventLoopGroupcreate(io.netty.channel.EventLoopGroup eventLoopGroup, io.netty.channel.ChannelFactory<? extends io.netty.channel.Channel> channelFactory)Creates a new instance of SdkEventLoopGroup withEventLoopGroupandChannelFactoryto be used withNettyNioAsyncHttpClient.io.netty.channel.ChannelFactory<? extends io.netty.channel.socket.DatagramChannel>datagramChannelFactory()io.netty.channel.EventLoopGroupeventLoopGroup()
-
-
-
Method Detail
-
eventLoopGroup
public io.netty.channel.EventLoopGroup eventLoopGroup()
- Returns:
- the
EventLoopGroupto be used with Netty Http client.
-
channelFactory
public io.netty.channel.ChannelFactory<? extends io.netty.channel.Channel> channelFactory()
- Returns:
- the
ChannelFactoryto be used with Netty Http Client.
-
datagramChannelFactory
public io.netty.channel.ChannelFactory<? extends io.netty.channel.socket.DatagramChannel> datagramChannelFactory()
- Returns:
- the
ChannelFactoryfor datagram channels to be used with Netty Http Client.
-
create
public static SdkEventLoopGroup create(io.netty.channel.EventLoopGroup eventLoopGroup, io.netty.channel.ChannelFactory<? extends io.netty.channel.Channel> channelFactory)
Creates a new instance of SdkEventLoopGroup withEventLoopGroupandChannelFactoryto be used withNettyNioAsyncHttpClient.- Parameters:
eventLoopGroup- the EventLoopGroup to be usedchannelFactory- the channel factor to be used- Returns:
- a new instance of SdkEventLoopGroup
-
create
public static SdkEventLoopGroup create(io.netty.channel.EventLoopGroup eventLoopGroup)
Creates a new instance of SdkEventLoopGroup withEventLoopGroup.ChannelFactorywill be resolved based on the type ofEventLoopGroupprovided. IllegalArgumentException will be thrown for any unknown EventLoopGroup type.- Parameters:
eventLoopGroup- the EventLoopGroup to be used- Returns:
- a new instance of SdkEventLoopGroup
-
builder
public static SdkEventLoopGroup.Builder builder()
-
-