SelectionKey

AbstractSelectionKey is the base implementation class for selection keys.

Class Overview

A SelectionKey represents the relationship between a channel and a
selector for which the channel is registered.

Operation set

An operation set is represented by an integer value. The bits of an operation
set represent categories of operations for a key's channel: Accepting socket
connections (OP_ACCEPT), connecting with a socket (OP_CONNECT),
reading (OP_READ) and writing (OP_WRITE).

Interest set

The interest set is an operation set that defines the operations that a
channel is interested in performing.

Ready set

The ready set is an operation set that shows the operations that a
channel is ready to execute.

Returns

public
abstract
void
cancel()

A key that has been canceled is no longer valid. Calling this method on
an already canceled key does nothing.

Calling this method is safe at any time. The call might block until
another ongoing call to a method of this selector has finished. The
reason is that it is synchronizing on the key set of the selector. After
this call finishes, the key will have been added to the selectors
canceled-keys set and will not be included in any future selects of this
selector.