java.nio.channels.spi
public
abstract
class
java.nio.channels.spi.AbstractSelector
Abstract class for selectors.
This class realizes the interruption of selection by begin
and
end
. It also holds the cancelled and the deletion of the key
set.
Summary
Protected Constructors
Public Methods
Protected Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Protected Constructors
protected
AbstractSelector(SelectorProvider selectorProvider)
Constructor for this class.
Parameters
selectorProvider
| A instance of SelectorProvider
|
Public Methods
public
final
synchronized
void
close()
public
final
boolean
isOpen()
Tells whether this selector is open.
Returns
- true if this selector is not closed
Returns the SelectorProvider of this channel.
Returns
- the provider of this selector
Protected Methods
protected
final
void
begin()
This starts a potentially blocking I/O operation
protected
final
Set<SelectionKey>
cancelledKeys()
Returns the cancelled key set of this channel.
Deletes the key from channel's key set.
protected
final
void
end()
This ends a potentially blocking I/O operation
protected
abstract
void
implCloseSelector()
Implements the closing of this channel.
Registers a channel to this selector.
Parameters
channel
| The channel to be registered. |
operations
| The interest set. |
attachment
| The attachment of the key. |
Returns
- The key related with the channel and the selector.