| |
|
| java.lang.Object java.nio.channels.Selector java.nio.channels.spi.AbstractSelector
Method Summary | |
final protected void | begin() Marks the beginning of an I/O operation that might block indefinitely.
This method should be invoked in tandem with the
AbstractSelector.end end method, using a try ... finally block as
shown above, in order to implement interruption for
this selector.
Invoking this method arranges for the selector's
Selector.wakeup wakeup method to be invoked if a thread's
Thread.interrupt interrupt method is invoked while the thread is
blocked in an I/O operation upon the selector. | void | cancel(SelectionKey k) | final protected Set<SelectionKey> | cancelledKeys() Retrieves this selector's cancelled-key set.
This set should only be used while synchronized upon it. | final public void | close() Closes this selector.
If the selector has already been closed then this method returns
immediately. | final protected void | deregister(AbstractSelectionKey key) Removes the given key from its channel's key set.
This method must be invoked by the selector for each channel that it
deregisters. | final protected void | end() Marks the end of an I/O operation that might block indefinitely.
This method should be invoked in tandem with the
AbstractSelector.begin begin method, using a try ... finally block as
shown above, in order to implement interruption for
this selector. | abstract protected void | implCloseSelector() Closes this selector.
This method is invoked by the
AbstractSelector.close close method in order
to perform the actual work of closing the selector. | final public boolean | isOpen() | final public SelectorProvider | provider() Returns the provider that created this channel. | abstract protected SelectionKey | register(AbstractSelectableChannel ch, int ops, Object att) Registers the given channel with this selector.
This method is invoked by a channel's
AbstractSelectableChannel.register register method in order to perform
the actual work of registering the channel with this selector. |
AbstractSelector | protected AbstractSelector(SelectorProvider provider)(Code) | | Initializes a new instance of this class.
|
begin | final protected void begin()(Code) | | Marks the beginning of an I/O operation that might block indefinitely.
This method should be invoked in tandem with the
AbstractSelector.end end method, using a try ... finally block as
shown above, in order to implement interruption for
this selector.
Invoking this method arranges for the selector's
Selector.wakeup wakeup method to be invoked if a thread's
Thread.interrupt interrupt method is invoked while the thread is
blocked in an I/O operation upon the selector.
|
cancelledKeys | final protected Set<SelectionKey> cancelledKeys()(Code) | | Retrieves this selector's cancelled-key set.
This set should only be used while synchronized upon it.
The cancelled-key set |
close | final public void close() throws IOException(Code) | | Closes this selector.
If the selector has already been closed then this method returns
immediately. Otherwise it marks the selector as closed and then invokes
the
AbstractSelector.implCloseSelector implCloseSelector method in order to
complete the close operation.
throws: IOException - If an I/O error occurs |
deregister | final protected void deregister(AbstractSelectionKey key)(Code) | | Removes the given key from its channel's key set.
This method must be invoked by the selector for each channel that it
deregisters.
Parameters: key - The selection key to be removed |
end | final protected void end()(Code) | | Marks the end of an I/O operation that might block indefinitely.
This method should be invoked in tandem with the
AbstractSelector.begin begin method, using a try ... finally block as
shown above, in order to implement interruption for
this selector.
|
implCloseSelector | abstract protected void implCloseSelector() throws IOException(Code) | | Closes this selector.
This method is invoked by the
AbstractSelector.close close method in order
to perform the actual work of closing the selector. This method is only
invoked if the selector has not yet been closed, and it is never invoked
more than once.
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
java.nio.channels.Selector.wakeup wakeup method.
throws: IOException - If an I/O error occurs while closing the selector |
isOpen | final public boolean isOpen()(Code) | | |
provider | final public SelectorProvider provider()(Code) | | Returns the provider that created this channel.
The provider that created this channel |
register | abstract protected SelectionKey register(AbstractSelectableChannel ch, int ops, Object att)(Code) | | Registers the given channel with this selector.
This method is invoked by a channel's
AbstractSelectableChannel.register register method in order to perform
the actual work of registering the channel with this selector.
Parameters: ch - The channel to be registered Parameters: ops - The initial interest set, which must be valid Parameters: att - The initial attachment for the resulting key A new key representing the registration of the given channelwith this selector |
|
|
|