java.nio.channels
public abstract class Selector extends Object
Since: 1.4
| Constructor Summary | |
|---|---|
| protected | Selector()
Initializes the selector. |
| Method Summary | |
|---|---|
| abstract void | close()
Closes the selector.
|
| abstract boolean | isOpen()
Tells whether the selector is open or not. |
| abstract Set<SelectionKey> | keys()
Returns this selector's key set.
|
| static Selector | open()
Opens a selector.
|
| abstract SelectorProvider | provider()
Returns the SelectorProvider that created the selector. |
| abstract int | select()
Selects a set of keys whose corresponding channels are ready
for I/O operations.
|
| abstract int | select(long timeout)
Selects a set of keys whose corresponding channels are ready
for I/O operations.
|
| abstract Set<SelectionKey> | selectedKeys()
Returns this selector's selected-key set.
|
| abstract int | selectNow()
Selects a set of keys whose corresponding channels are ready
for I/O operations.
|
| abstract Selector | wakeup()
Causes the first selection operation that has not yet returned to
return immediately. |
Throws: IOException If an error occurs
Throws: ClosedSelectorException If this selector is closed.
Throws: IOException If an error occurs
Throws: ClosedSelectorException If this selector is closed. IOException If an error occurs
Parameters: timeout The timeout to use.
Throws: ClosedSelectorException If this selector is closed. IllegalArgumentException If the timeout value is negative. IOException If an error occurs
Throws: ClosedSelectorException If this selector is closed.
Throws: ClosedSelectorException If this selector is closed. IOException If an error occurs