Expose the SelectorProvider used by the NioEventLoop

Motivation:

If a user writes an own nio based transport which uses a special SelectorProvider it is useful to be able to get the SelectorProvider that is used by a NioEventLoop. This way this can be used when implement AbstractChannel.isCompatible(...) and check that the SelectorProvider is the correct one.

Modifications:

Expose the SelectorProvider.

Result:

Be able to get the SelectorProvider used by a NioEventLoop.
This commit is contained in:
Norman Maurer 2016-06-09 09:44:06 +02:00
parent 6aa5f76d42
commit 31e0ac1d22

View File

@ -184,6 +184,13 @@ public final class NioEventLoop extends SingleThreadEventLoop {
return selector;
}
/**
* Returns the {@link SelectorProvider} used by this {@link NioEventLoop} to obtain the {@link Selector}.
*/
public SelectorProvider selectorProvider() {
return provider;
}
@Override
protected Queue<Runnable> newTaskQueue() {
// This event loop never calls takeTask()