java.nio.channels.spi
public abstract class AbstractSelector extends Selector
Modifier | Constructor and Description |
---|---|
protected |
AbstractSelector(SelectorProvider provider)
Initializes the slector.
|
Modifier and Type | Method and Description |
---|---|
protected void |
begin()
Marks the beginning of an I/O operation that might block indefinitely.
|
protected Set<SelectionKey> |
cancelledKeys()
Returns the cancelled keys set.
|
void |
close()
Closes the channel.
|
protected void |
deregister(AbstractSelectionKey key)
Deregisters the given selection key.
|
protected void |
end()
Marks the end of an I/O operation that might block indefinitely.
|
protected abstract void |
implCloseSelector()
Closes the channel.
|
boolean |
isOpen()
Tells whether this channel is open or not.
|
SelectorProvider |
provider()
Returns the provider for this selector object.
|
protected abstract SelectionKey |
register(AbstractSelectableChannel ch,
int ops,
Object att)
Registers a channel for the selection process.
|
protected AbstractSelector(SelectorProvider provider)
provider
- the provider that created this selectorpublic final void close() throws IOException
close
in class Selector
IOException
- If an error occurspublic final boolean isOpen()
protected final void begin()
protected final void end()
public final SelectorProvider provider()
protected final Set<SelectionKey> cancelledKeys()
protected abstract void implCloseSelector() throws IOException
IOException
- if an error occursprotected abstract SelectionKey register(AbstractSelectableChannel ch, int ops, Object att)
ch
- the channel registerops
- the interested operationsatt
- an attachement to the selection keyprotected final void deregister(AbstractSelectionKey key)
key
- the key to deregister