public abstract class AbstractSelectionKey extends SelectionKey
该类跟踪密钥的有效性,并实现消除。
OP_ACCEPT, OP_CONNECT, OP_READ, OP_WRITE
Modifier | Constructor and Description |
---|---|
protected |
AbstractSelectionKey()
初始化此类的新实例。
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
取消此键。
|
boolean |
isValid()
告知这个密钥是否有效。
|
attach, attachment, channel, interestOps, interestOps, isAcceptable, isConnectable, isReadable, isWritable, readyOps, selector
public final boolean isValid()
SelectionKey
钥匙在创建时有效,并保持原样,直到它被取消,其通道关闭或其选择器关闭。
isValid
在
SelectionKey
public final void cancel()
如果此键尚未被取消,则在该组同步时将其添加到其选择器的已取消键集合中。
cancel
在
SelectionKey
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.