| Modifier and Type | Field and Description |
|---|---|
| private final Deque | |
| private boolean | |
| private final Set | |
| private final Set | |
| private final Set | |
| private final Set |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected final void | |
| public void | |
| protected abstract int | doSelect(Consumer<SelectionKey>
the action to perform, can be null action, long timeout in milliseconds to wait, 0 to not wait, -1 to
wait indefinitely timeout)Hides java. Selects the keys for channels that are ready for I/O operations. |
| protected final void | |
| private void | |
| protected abstract void | |
| public final void | implCloseSelector()
Implements abstract java. Closes this selector. |
| protected abstract void | |
| protected void | |
| public final Set | |
| private int | |
| protected final void | |
| protected final int | processReadyEvents(int rOps, SelectionKeyImpl ski, Consumer<SelectionKey> action)
Invoked by selection operations to handle ready events. |
| protected final SelectionKey | register(AbstractSelectableChannel ch, int ops, Object attachment)
Implements abstract java. Registers the given channel with this selector. |
| public final int | select(long timeout)
Implements abstract java. Selects a set of keys whose corresponding channels are ready for I/O operations. |
| public final int | select()
Implements abstract java. Selects a set of keys whose corresponding channels are ready for I/O operations. |
| public final int | select(Consumer<SelectionKey> action, long timeout)
Overrides java. Selects and performs an action on the keys whose corresponding channels are ready for I/O operations. |
| public final int | select(Consumer<SelectionKey> action)
Overrides java. Selects and performs an action on the keys whose corresponding channels are ready for I/O operations. |
| public final Set | selectedKeys()
Implements abstract java. Returns this selector's selected-key set. |
| public final int | selectNow()
Implements abstract java. Selects a set of keys whose corresponding channels are ready for I/O operations. |
| public final int | selectNow(Consumer<SelectionKey> action)
Overrides java. Selects and performs an action on the keys whose corresponding channels are ready for I/O operations. |
| protected abstract void | setEventOps(SelectionKeyImpl ski)
Invoked by interestOps to ensure the interest ops are updated at the next selection operation. |
| cancelledKeys | back to summary |
|---|---|
| private final Deque<SelectionKeyImpl> cancelledKeys | |
| inSelect | back to summary |
|---|---|
| private boolean inSelect | |
| keys | back to summary |
|---|---|
| private final Set<SelectionKey> keys | |
| publicKeys | back to summary |
|---|---|
| private final Set<SelectionKey> publicKeys | |
| publicSelectedKeys | back to summary |
|---|---|
| private final Set<SelectionKey> publicSelectedKeys | |
| selectedKeys | back to summary |
|---|---|
| private final Set<SelectionKey> selectedKeys | |
| SelectorImpl | back to summary |
|---|---|
| protected SelectorImpl(SelectorProvider sp) | |
| begin | back to summary |
|---|---|
| protected final void begin(boolean blocking) Marks the beginning of a select operation that might block | |
| cancel | back to summary |
|---|---|
| public void cancel(SelectionKeyImpl ski) Queue a cancelled key for the next selection operation | |
| doSelect | back to summary |
|---|---|
| protected abstract int doSelect(Consumer<SelectionKey> action, long timeout) throws IOException Hides java. Selects the keys for channels that are ready for I/O operations.
| |
| end | back to summary |
|---|---|
| protected final void end(boolean blocking) Marks the end of a select operation that may have blocked | |
| ensureOpen | back to summary |
|---|---|
| private void ensureOpen() | |
| implClose | back to summary |
|---|---|
| protected abstract void implClose() throws IOException Invoked by implCloseSelector to close the selector. | |
| implCloseSelector | back to summary |
|---|---|
| public final void implCloseSelector() throws IOException Implements abstract java. Doc from java. Closes this selector. This method is invoked by the An implementation of this method must arrange for any other thread
that is blocked in a selection operation upon this selector to return
immediately as if by invoking the
| |
| implDereg | back to summary |
|---|---|
| protected abstract void implDereg(SelectionKeyImpl ski) throws IOException Removes the key from the selector | |
| implRegister | back to summary |
|---|---|
| protected void implRegister(SelectionKeyImpl ski) Register the key in the selector. The default implementation checks if the selector is open. It should be overridden by selector implementations as needed. | |
| keys | back to summary |
|---|---|
| public final Set Implements abstract java. Doc from java. Returns this selector's key set. The key set is not directly modifiable. A key is removed only after
it has been cancelled and its channel has been deregistered. Any
attempt to modify the key set will cause an The set is safe for use by multiple concurrent threads.
| |
| lockAndDoSelect | back to summary |
|---|---|
| private int lockAndDoSelect(Consumer<SelectionKey> action, long timeout) throws IOException | |
| processDeregisterQueue | back to summary |
|---|---|
| protected final void processDeregisterQueue() throws IOException Invoked by selection operations to process the cancelled keys | |
| processReadyEvents | back to summary |
|---|---|
| protected final int processReadyEvents(int rOps, SelectionKeyImpl ski, Consumer<SelectionKey> action) Invoked by selection operations to handle ready events. If an action is specified then it is invoked to handle the key, otherwise the key is added to the selected-key set (or updated when it is already in the set). | |
| register | back to summary |
|---|---|
| protected final SelectionKey register(AbstractSelectableChannel ch, int ops, Object attachment) Implements abstract java. Doc from java. Registers the given channel with this selector. This method is invoked by a channel's
| |
| select | back to summary |
|---|---|
| public final int select(long timeout) throws IOException Implements abstract java. Doc from java. Selects a set of keys whose corresponding channels are ready for I/O operations. This method performs a blocking selection
operation. It returns only after at least one channel is selected,
this selector's This method does not offer real-time guarantees: It schedules the
timeout as if by invoking the
| |
| select | back to summary |
|---|---|
| public final int select() throws IOException Implements abstract java. Doc from java. Selects a set of keys whose corresponding channels are ready for I/O operations. This method performs a blocking selection
operation. It returns only after at least one channel is selected,
this selector's
| |
| select | back to summary |
|---|---|
| public final int select(Consumer<SelectionKey> action, long timeout) throws IOException Overrides java. Doc from java. Selects and performs an action on the keys whose corresponding channels are ready for I/O operations. This method performs a blocking selection
operation. It wakes up from querying the operating system only when
at least one channel is selected, this selector's The specified action's This method does not offer real-time guarantees: It schedules the
timeout as if by invoking the
| |
| select | back to summary |
|---|---|
| public final int select(Consumer<SelectionKey> action) throws IOException Overrides java. Doc from java. Selects and performs an action on the keys whose corresponding channels are ready for I/O operations. This method performs a blocking selection
operation. It wakes up from querying the operating system only when
at least one channel is selected, this selector's This method is equivalent to invoking the 2-arg
| |
| selectedKeys | back to summary |
|---|---|
| public final Set Implements abstract java. Doc from java. Returns this selector's selected-key set. Keys may be removed from, but not directly added to, the
selected-key set. Any attempt to add an object to the key set will
cause an The selected-key set is not thread-safe.
| |
| selectNow | back to summary |
|---|---|
| public final int selectNow() throws IOException Implements abstract java. Doc from java. Selects a set of keys whose corresponding channels are ready for I/O operations. This method performs a non-blocking selection operation. If no channels have become selectable since the previous selection operation then this method immediately returns zero. Invoking this method clears the effect of any previous invocations
of the
| |
| selectNow | back to summary |
|---|---|
| public final int selectNow(Consumer<SelectionKey> action) throws IOException Overrides java. Doc from java. Selects and performs an action on the keys whose corresponding channels are ready for I/O operations. This method performs a non-blocking selection operation. Invoking this method clears the effect of any previous invocations
of the
| |
| setEventOps | back to summary |
|---|---|
| protected abstract void setEventOps(SelectionKeyImpl ski) Invoked by interestOps to ensure the interest ops are updated at the next selection operation. | |