import io.netty.channel.nio.NioEventLoopGroup;
import java.util.concurrent.TimeUnit;
-public class NioEventLoopGroupCloseable extends NioEventLoopGroup implements AutoCloseable {
- private NioEventLoopGroupCloseable(int threadCount) {
+public final class NioEventLoopGroupCloseable extends NioEventLoopGroup implements AutoCloseable {
+ private NioEventLoopGroupCloseable(final int threadCount) {
super(threadCount);
}
private NioEventLoopGroupCloseable() {
- super();
}
@Override
- public void close() throws Exception {
+ public void close() {
shutdownGracefully(0, 1, TimeUnit.SECONDS);
}
- public static NioEventLoopGroupCloseable newInstance(Integer threadCount) {
- if(threadCount == null || threadCount <= 0) {
+ public static NioEventLoopGroupCloseable newInstance(final Integer threadCount) {
+ if (threadCount == null || threadCount <= 0) {
return new NioEventLoopGroupCloseable();
}
return new NioEventLoopGroupCloseable(threadCount);
}
-}
\ No newline at end of file
+}