Class ManagedSelector

    • Field Detail

      • LOG

        private static final Logger LOG
      • FORCE_SELECT_NOW

        private static final boolean FORCE_SELECT_NOW
      • _started

        private final java.util.concurrent.atomic.AtomicBoolean _started
      • _selecting

        private boolean _selecting
      • _id

        private final int _id
      • _selector

        private java.nio.channels.Selector _selector
    • Constructor Detail

      • ManagedSelector

        public ManagedSelector​(SelectorManager selectorManager,
                               int id)
    • Method Detail

      • getSelector

        public java.nio.channels.Selector getSelector()
      • doStart

        protected void doStart()
                        throws java.lang.Exception
        Description copied from class: ContainerLifeCycle
        Starts the managed lifecycle beans in the order they were added.
        Overrides:
        doStart in class ContainerLifeCycle
        Throws:
        java.lang.Exception
      • doStop

        protected void doStop()
                       throws java.lang.Exception
        Description copied from class: ContainerLifeCycle
        Stops the managed lifecycle beans in the reverse order they were added.
        Overrides:
        doStop in class ContainerLifeCycle
        Throws:
        java.lang.Exception
      • nioSelect

        protected int nioSelect​(java.nio.channels.Selector selector,
                                boolean now)
                         throws java.io.IOException
        Throws:
        java.io.IOException
      • select

        protected int select​(java.nio.channels.Selector selector)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • handleSelectFailure

        protected void handleSelectFailure​(java.nio.channels.Selector selector,
                                           java.lang.Throwable failure)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • onSelectFailed

        protected void onSelectFailed​(java.lang.Throwable cause)
      • size

        public int size()
      • wakeup

        private void wakeup()
      • execute

        private void execute​(java.lang.Runnable task)
      • processConnect

        private void processConnect​(java.nio.channels.SelectionKey key,
                                    ManagedSelector.Connect connect)
      • endPointOpened

        protected void endPointOpened​(EndPoint endPoint)
      • endPointClosed

        protected void endPointClosed​(EndPoint endPoint)
      • createEndPoint

        private void createEndPoint​(java.nio.channels.SelectableChannel channel,
                                    java.nio.channels.SelectionKey selectionKey)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • destroyEndPoint

        void destroyEndPoint​(EndPoint endPoint)
      • getActionSize

        private int getActionSize()
      • safeReadyOps

        static int safeReadyOps​(java.nio.channels.SelectionKey selectionKey)
      • safeInterestOps

        static int safeInterestOps​(java.nio.channels.SelectionKey selectionKey)
      • dump

        public void dump​(java.lang.Appendable out,
                         java.lang.String indent)
                  throws java.io.IOException
        Description copied from interface: Dumpable
        Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
        Specified by:
        dump in interface Dumpable
        Overrides:
        dump in class ContainerLifeCycle
        Parameters:
        out - The appendable to dump to
        indent - The indent to apply after any new lines.
        Throws:
        java.io.IOException - if unable to write to Appendable