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.