Reactive编程

Selector类

类图

@startuml

interface Closeable{
    + void close()
}
interface AutoCloseable{
    + void close()
}

abstract class Selector{
    # Selector()
    + Selector open()
    + boolean isOpen()
    + SelectorProvider provider()
    + Set<SelectionKey> keys()
    + Set<SelectionKey> selectedKeys()
    + int selectNow()
    + int select()
    + int select(long timeout)
    + Selector wakeup()
    + void close()
}
abstract class AbstractSelector{
    + AtomicBoolean selectorOpen
    - SelectorProvider provider
    - Set<SelectionKey> cancelledKeys
    - Interruptible interruptor
    # AbstractSelector(SelectorProvider provider)
    # void begin()
    # void end()
}

abstract class SelectorImpl{
    # Set<SelectionKey> selectedKeys
    # HashSet<SelectionKey> keys
    # Set<SelectionKey> publicKeys
    # Set<SelectionKey> publicSelectedKeys
    # SelectorImpl(SelectorProvider var1)
    # Set<SelectionKey> keys()
    # Set<SelectionKey> selectedKeys()
}
class WindowsSelectorImpl {

}

abstract class SelectionKey {
    # SelectionKey()
    + SelectableChannel channel()
    + Selector selector()
    + boolean isValid()
    + void cancel()
    + int interestOps()
    + SelectionKey interestOps(int ops)
    + int readyOps()
}


Selector <|-- AbstractSelector
AutoCloseable <|-- Closeable
Closeable <|-- Selector
AbstractSelector <|-- SelectorImpl
SelectorImpl <|-- WindowsSelectorImpl
SelectionKey <.. Selector
SelectionKey <.. SelectorImpl
SelectionKey <.. AbstractSelector
SelectionKey <.. WindowsSelectorImpl

@enduml
selector.png
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容