diff --git a/transport/src/main/java/io/netty/channel/socket/nio/AbstractNioChannel.java b/transport/src/main/java/io/netty/channel/socket/nio/AbstractNioChannel.java index 4131ba4e6f..71259fdc72 100644 --- a/transport/src/main/java/io/netty/channel/socket/nio/AbstractNioChannel.java +++ b/transport/src/main/java/io/netty/channel/socket/nio/AbstractNioChannel.java @@ -39,9 +39,9 @@ import java.util.concurrent.atomic.AtomicInteger; public abstract class AbstractNioChannel extends AbstractChannel implements NioChannel { /** - * The {@link AbstractNioWorker}. + * The {@link SelectorEventLoop}. */ - private final AbstractNioWorker worker; + private final SelectorEventLoop worker; /** * Monitor object to synchronize access to InterestedOps. @@ -97,7 +97,7 @@ public abstract class AbstractNioChannel extends AbstractChannel implements NioC private final JdkChannel channel; - protected AbstractNioChannel(Integer id, Channel parent, ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink, AbstractNioWorker worker, JdkChannel ch) { + protected AbstractNioChannel(Integer id, Channel parent, ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink, SelectorEventLoop worker, JdkChannel ch) { super(id, parent, factory, pipeline, sink); this.worker = worker; this.channel = ch; @@ -105,7 +105,7 @@ public abstract class AbstractNioChannel extends AbstractChannel implements NioC protected AbstractNioChannel( Channel parent, ChannelFactory factory, - ChannelPipeline pipeline, ChannelSink sink, AbstractNioWorker worker, JdkChannel ch) { + ChannelPipeline pipeline, ChannelSink sink, SelectorEventLoop worker, JdkChannel ch) { super(parent, factory, pipeline, sink); this.worker = worker; this.channel = ch; @@ -116,11 +116,11 @@ public abstract class AbstractNioChannel extends AbstractChannel implements NioC } /** - * Return the {@link AbstractNioWorker} that handle the IO of the {@link AbstractNioChannel} + * Return the {@link SelectorEventLoop} that handle the IO of the {@link AbstractNioChannel} * * @return worker */ - public AbstractNioWorker getWorker() { + public SelectorEventLoop getWorker() { return worker; } diff --git a/transport/src/main/java/io/netty/channel/socket/nio/AbstractNioWorkerPool.java b/transport/src/main/java/io/netty/channel/socket/nio/AbstractNioWorkerPool.java index ce1e314eb9..fb64811e52 100644 --- a/transport/src/main/java/io/netty/channel/socket/nio/AbstractNioWorkerPool.java +++ b/transport/src/main/java/io/netty/channel/socket/nio/AbstractNioWorkerPool.java @@ -29,9 +29,9 @@ import java.util.concurrent.atomic.AtomicInteger; * {@link #nextWorker()} * */ -public abstract class AbstractNioWorkerPool implements WorkerPool , ExternalResourceReleasable { +public abstract class AbstractNioWorkerPool implements WorkerPool , ExternalResourceReleasable { - private final AbstractNioWorker[] workers; + private final SelectorEventLoop[] workers; private final AtomicInteger workerIndex = new AtomicInteger(); private final Executor workerExecutor; @@ -51,7 +51,7 @@ public abstract class AbstractNioWorkerPool impleme "workerCount (" + workerCount + ") " + "must be a positive integer."); } - workers = new AbstractNioWorker[workerCount]; + workers = new SelectorEventLoop[workerCount]; for (int i = 0; i < workers.length; i++) { workers[i] = createWorker(workerExecutor, allowShutDownOnIdle); diff --git a/transport/src/main/java/io/netty/channel/socket/nio/NioDatagramWorker.java b/transport/src/main/java/io/netty/channel/socket/nio/NioDatagramWorker.java index 712b21fa99..81e8bbfddd 100644 --- a/transport/src/main/java/io/netty/channel/socket/nio/NioDatagramWorker.java +++ b/transport/src/main/java/io/netty/channel/socket/nio/NioDatagramWorker.java @@ -43,7 +43,7 @@ import java.util.concurrent.Executor; * A class responsible for registering channels with {@link Selector}. * It also implements the {@link Selector} loop. */ -public class NioDatagramWorker extends AbstractNioWorker { +public class NioDatagramWorker extends SelectorEventLoop { /** * Sole constructor. diff --git a/transport/src/main/java/io/netty/channel/socket/nio/NioWorker.java b/transport/src/main/java/io/netty/channel/socket/nio/NioWorker.java index 4809133d53..5da091776a 100644 --- a/transport/src/main/java/io/netty/channel/socket/nio/NioWorker.java +++ b/transport/src/main/java/io/netty/channel/socket/nio/NioWorker.java @@ -34,7 +34,7 @@ import java.nio.channels.SelectionKey; import java.nio.channels.SocketChannel; import java.util.concurrent.Executor; -public class NioWorker extends AbstractNioWorker { +public class NioWorker extends SelectorEventLoop { protected final ReceiveBufferPool recvBufferPool = new ReceiveBufferPool(); diff --git a/transport/src/main/java/io/netty/channel/socket/nio/AbstractNioWorker.java b/transport/src/main/java/io/netty/channel/socket/nio/SelectorEventLoop.java similarity index 99% rename from transport/src/main/java/io/netty/channel/socket/nio/AbstractNioWorker.java rename to transport/src/main/java/io/netty/channel/socket/nio/SelectorEventLoop.java index 0d2e7952f8..6772c4d9ee 100644 --- a/transport/src/main/java/io/netty/channel/socket/nio/AbstractNioWorker.java +++ b/transport/src/main/java/io/netty/channel/socket/nio/SelectorEventLoop.java @@ -47,12 +47,12 @@ import java.util.concurrent.locks.ReentrantReadWriteLock; import static io.netty.channel.Channels.*; -abstract class AbstractNioWorker extends SingleThreadEventLoop { +abstract class SelectorEventLoop extends SingleThreadEventLoop { /** * Internal Netty logger. */ protected static final InternalLogger logger = InternalLoggerFactory - .getInstance(AbstractNioWorker.class); + .getInstance(SelectorEventLoop.class); private static final int CONSTRAINT_LEVEL = NioProviderMetadata.CONSTRAINT_LEVEL; @@ -86,11 +86,11 @@ abstract class AbstractNioWorker extends SingleThreadEventLoop { protected final SendBufferPool sendBufferPool = new SendBufferPool(); - protected AbstractNioWorker() { + protected SelectorEventLoop() { selector = openSelector(); } - protected AbstractNioWorker(ThreadFactory threadFactory) { + protected SelectorEventLoop(ThreadFactory threadFactory) { super(threadFactory); selector = openSelector(); }