Class IOReactorExecutor<T extends IOReactorService>

  • All Implemented Interfaces:
    java.lang.AutoCloseable
    Direct Known Subclasses:
    AsyncRequester, AsyncServer

    abstract class IOReactorExecutor<T extends IOReactorService>
    extends java.lang.Object
    implements java.lang.AutoCloseable
    • Field Detail

      • workerThreadFactory

        private final java.util.concurrent.ThreadFactory workerThreadFactory
      • ioReactorRef

        private final java.util.concurrent.atomic.AtomicReference<T extends IOReactorService> ioReactorRef
    • Constructor Detail

      • IOReactorExecutor

        IOReactorExecutor​(IOReactorConfig ioReactorConfig,
                          java.util.concurrent.ThreadFactory workerThreadFactory)
    • Method Detail

      • createIOReactor

        abstract T createIOReactor​(IOEventHandlerFactory ioEventHandlerFactory,
                                   IOReactorConfig ioReactorConfig,
                                   java.util.concurrent.ThreadFactory threadFactory,
                                   Callback<IOSession> sessionShutdownCallback)
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • execute

        protected void execute​(IOEventHandlerFactory ioEventHandlerFactory)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • ensureRunning

        private T ensureRunning()
      • reactor

        T reactor()
      • awaitShutdown

        public void awaitShutdown​(TimeValue waitTime)
                           throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • initiateShutdown

        public void initiateShutdown()
      • shutdown

        public void shutdown​(TimeValue graceTime)
      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface java.lang.AutoCloseable
        Throws:
        java.lang.Exception