Package org.ldaptive.transport.netty
Class NettyUtils
- java.lang.Object
-
- org.ldaptive.transport.netty.NettyUtils
-
public final class NettyUtils extends java.lang.ObjectProvides utility methods for this package.- Author:
- Middleware Services
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static io.netty.channel.EventLoopGroupcreateDefaultEventLoopGroup(java.lang.String name, int numThreads)Returns the default event loop group for this platform.static java.lang.Class<? extends io.netty.channel.Channel>getDefaultSocketChannelType()Returns the default socket channel type for this platform.static voidshutdownGracefully(io.netty.channel.EventLoopGroup workerGroup)InvokesEventExecutorGroup.shutdownGracefully(long, long, TimeUnit)on the supplied worker group.
-
-
-
Method Detail
-
getDefaultSocketChannelType
public static java.lang.Class<? extends io.netty.channel.Channel> getDefaultSocketChannelType()
Returns the default socket channel type for this platform. SeeEpoll.isAvailable()andKQueue.isAvailable().- Returns:
- socket channel type
-
createDefaultEventLoopGroup
public static io.netty.channel.EventLoopGroup createDefaultEventLoopGroup(java.lang.String name, int numThreads)Returns the default event loop group for this platform. SeeEpoll.isAvailable()andKQueue.isAvailable(). Set numThreads to zero to use the netty default.- Parameters:
name- of the thread poolnumThreads- number of threads in the thread pool- Returns:
- event loop group
-
shutdownGracefully
public static void shutdownGracefully(io.netty.channel.EventLoopGroup workerGroup)
InvokesEventExecutorGroup.shutdownGracefully(long, long, TimeUnit)on the supplied worker group. This method blocks for twice theDEFAULT_SHUTDOWN_MAX_TIMEOUTwaiting for the shutdown to be done. If the future is not invoked in that timeframe a warning is logged.- Parameters:
workerGroup- to shutdown
-
-