IoHandler implementation which register the Channel's to a
Selector and so does the multi-plexing of these in the event loop.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private static final int | |
| private static final boolean | |
| private static final InternalLogger | |
| private static final int | |
| private boolean | |
| private final SelectorProvider | |
| private SelectedSelectionKeySet | |
| private final IntSupplier | |
| private Selector | |
| private static final int | |
| private final SelectStrategy | |
| private Selector | |
| private final AtomicBoolean | wakenUp
Boolean that controls determines if a blocked Selector.select should break out of its selection process. |
| Access | Constructor and Description |
|---|---|
| private | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | deregister(IoHandle
the handle)IoHandle to deregister..Implements io. IoHandle for IO.
|
| public void | destroy()
Implements io. IoHandler and free all its resources.
|
| private static void | |
| public boolean | isCompatible(Class<? extends IoHandle>
the type of the handleType)IoHandle.Implements io. true if the given type is compatible with this IoHandler and so can be registered,
false otherwise.
|
| public static IoHandlerFactory | |
| public static IoHandlerFactory | newFactory(final SelectorProvider selectorProvider, final SelectStrategyFactory selectStrategyFactory)
Returns a new |
| private static NioProcessor | |
| private NioHandler. | |
| public void | prepareToDestroy()
Implements io. IoHandler.
|
| private void | |
| private int | |
| private int | |
| private int | |
| pack-priv void | rebuildSelector()
Replaces the current |
| public void | register(IoHandle
the handle)Channel to register..Implements io. Channel for IO.
|
| public int | run(IoExecutionContext runner)
Implements io. IoHandler.
|
| private void | |
| private void | |
| private int | |
| public SelectorProvider | |
| private Selector | |
| pack-priv Selector | |
| public void | wakeup(boolean inEventLoop)
Implements io. IoHandler, which means if any operation blocks it should be unblocked and
return as soon as possible.
|
| cancelledKeys | back to summary |
|---|---|
| private int cancelledKeys | |
| CLEANUP_INTERVAL | back to summary |
|---|---|
| private static final int CLEANUP_INTERVAL | |
| DISABLE_KEY_SET_OPTIMIZATION | back to summary |
|---|---|
| private static final boolean DISABLE_KEY_SET_OPTIMIZATION | |
| logger | back to summary |
|---|---|
| private static final InternalLogger logger | |
| MIN_PREMATURE_SELECTOR_RETURNS | back to summary |
|---|---|
| private static final int MIN_PREMATURE_SELECTOR_RETURNS | |
| needsToSelectAgain | back to summary |
|---|---|
| private boolean needsToSelectAgain | |
| provider | back to summary |
|---|---|
| private final SelectorProvider provider | |
| selectedKeys | back to summary |
|---|---|
| private SelectedSelectionKeySet selectedKeys | |
| selectNowSupplier | back to summary |
|---|---|
| private final IntSupplier selectNowSupplier | |
| selector | back to summary |
|---|---|
| private Selector selector The NIO | |
| SELECTOR_AUTO_REBUILD_THRESHOLD | back to summary |
|---|---|
| private static final int SELECTOR_AUTO_REBUILD_THRESHOLD | |
| selectStrategy | back to summary |
|---|---|
| private final SelectStrategy selectStrategy | |
| unwrappedSelector | back to summary |
|---|---|
| private Selector unwrappedSelector | |
| wakenUp | back to summary |
|---|---|
| private final AtomicBoolean wakenUp Boolean that controls determines if a blocked Selector.select should break out of its selection process. In our case we use a timeout for the select method and the select method will block for that time unless waken up. | |
| NioHandler | back to summary |
|---|---|
| private NioHandler() | |
| NioHandler | back to summary |
|---|---|
| private NioHandler(SelectorProvider selectorProvider, SelectStrategy strategy) | |
| deregister | back to summary |
|---|---|
| public void deregister(IoHandle handle) Implements io. Doc from io. Deregister a | |
| destroy | back to summary |
|---|---|
| public void destroy() Implements io. Doc from io. Destroy the
| |
| handleLoopException | back to summary |
|---|---|
| private static void handleLoopException(Throwable t) | |
| isCompatible | back to summary |
|---|---|
| public boolean isCompatible(Class<? extends IoHandle> handleType) Implements io. Doc from io. Returns | |
| newFactory | back to summary |
|---|---|
| public static IoHandlerFactory newFactory() Returns a new | |
| newFactory | back to summary |
|---|---|
| public static IoHandlerFactory newFactory(final SelectorProvider selectorProvider, final SelectStrategyFactory selectStrategyFactory) Returns a new | |
| nioHandle | back to summary |
|---|---|
| private static NioProcessor nioHandle(IoHandle handle) | |
| openSelector | back to summary |
|---|---|
| private NioHandler. | |
| prepareToDestroy | back to summary |
|---|---|
| public void prepareToDestroy() Implements io. Doc from io. Prepare to destroy this
| |
| processSelectedKey | back to summary |
|---|---|
| private void processSelectedKey(SelectionKey k) | |
| processSelectedKeys | back to summary |
|---|---|
| private int processSelectedKeys() | |
| processSelectedKeysOptimized | back to summary |
|---|---|
| private int processSelectedKeysOptimized() | |
| processSelectedKeysPlain | back to summary |
|---|---|
| private int processSelectedKeysPlain(Set<SelectionKey> selectedKeys) | |
| rebuildSelector | back to summary |
|---|---|
| pack-priv void rebuildSelector() Replaces the current | |
| register | back to summary |
|---|---|
| public void register(IoHandle handle) throws Exception Implements io. Doc from io. Register a | |
| run | back to summary |
|---|---|
| public int run(IoExecutionContext runner) Implements io. Doc from io. Run the IO handled by this | |
| select | back to summary |
|---|---|
| private void select(IoExecutionContext runner, boolean oldWakenUp) throws IOException | |
| selectAgain | back to summary |
|---|---|
| private void selectAgain() | |
| selectNow | back to summary |
|---|---|
| private int selectNow() throws IOException | |
| selectorProvider | back to summary |
|---|---|
| public SelectorProvider selectorProvider() Returns the | |
| selectRebuildSelector | back to summary |
|---|---|
| private Selector selectRebuildSelector(int selectCnt) throws IOException | |
| unwrappedSelector | back to summary |
|---|---|
| pack-priv Selector unwrappedSelector() | |
| wakeup | back to summary |
|---|---|
| public void wakeup(boolean inEventLoop) Implements io. Doc from io. Wakeup the
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Selector | |
| pack-priv final Selector |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| selector | back to summary |
|---|---|
| pack-priv final Selector selector | |
| unwrappedSelector | back to summary |
|---|---|
| pack-priv final Selector unwrappedSelector | |
| SelectorTuple | back to summary |
|---|---|
| pack-priv SelectorTuple(Selector unwrappedSelector) | |
| SelectorTuple | back to summary |
|---|---|
| pack-priv SelectorTuple(Selector unwrappedSelector, Selector selector) | |