Reactive编程

2021-08-12  本文已影响0人  brightranger

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
上一篇下一篇

猜你喜欢

热点阅读