public class SniffySelector extends AbstractSelector
| Constructor and Description |
|---|
SniffySelector(SelectorProvider provider,
AbstractSelector delegate) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
implCloseSelector() |
Set<SelectionKey> |
keys() |
protected SelectionKey |
register(AbstractSelectableChannel ch,
int ops,
Object att)
This method adds a selection key to provided AbstractSelectableChannel, hence we're doing the same here manually
|
int |
select()
This methods processes de-register queue (filled-in using selectionKey.cancel() method)
As a result it modifies the cancelledKeys field and also removes selectionKeys from associated channels
|
int |
select(java.util.function.Consumer<SelectionKey> action) |
int |
select(java.util.function.Consumer<SelectionKey> action,
long timeout) |
int |
select(long timeout)
This methods processes de-register queue (filled-in using selectionKey.cancel() method)
As a result it modifies the cancelledKeys field and also removes selectionKeys from associated channels
|
Set<SelectionKey> |
selectedKeys() |
int |
selectNow()
This methods processes de-register queue (filled-in using selectionKey.cancel() method)
As a result it modifies the cancelledKeys field and also removes selectionKeys from associated channels
|
int |
selectNow(java.util.function.Consumer<SelectionKey> action) |
Selector |
wakeup() |
SniffySelectionKey |
wrap(SelectionKey delegate,
SniffySelector sniffySelector,
SelectableChannel sniffyChannel) |
begin, cancelledKeys, close, deregister, end, isOpen, providerpublic SniffySelector(SelectorProvider provider, AbstractSelector delegate)
public SniffySelectionKey wrap(SelectionKey delegate, SniffySelector sniffySelector, SelectableChannel sniffyChannel)
protected void implCloseSelector()
throws IOException
implCloseSelector in class AbstractSelectorIOExceptionprotected SelectionKey register(AbstractSelectableChannel ch, int ops, Object att)
register in class AbstractSelectorpublic Set<SelectionKey> keys()
public Set<SelectionKey> selectedKeys()
selectedKeys in class Selectorpublic int selectNow()
throws IOException
selectNow in class SelectorIOExceptionpublic int select(long timeout)
throws IOException
select in class SelectorIOExceptionpublic int select()
throws IOException
select in class SelectorIOExceptionpublic int select(java.util.function.Consumer<SelectionKey> action, long timeout) throws IOException
IOExceptionpublic int select(java.util.function.Consumer<SelectionKey> action) throws IOException
IOExceptionpublic int selectNow(java.util.function.Consumer<SelectionKey> action) throws IOException
IOExceptionCopyright © 2021. All rights reserved.