Class ExecutorNettyAdapter

  • All Implemented Interfaces:
    io.netty.channel.EventLoop, io.netty.channel.EventLoopGroup, io.netty.util.concurrent.EventExecutor, io.netty.util.concurrent.EventExecutorGroup, io.netty.util.concurrent.OrderedEventExecutor, AutoCloseable, Iterable<io.netty.util.concurrent.EventExecutor>, Executor, ExecutorService, ScheduledExecutorService

    public class ExecutorNettyAdapter
    extends Object
    implements io.netty.channel.EventLoop, AutoCloseable
    Test cases may supply a simple executor instead of the real Netty Executor On that case this is a simple adapter for what's needed from these tests. Not intended to be used in production. TODO: This could be refactored out of the main codebase but at a high cost. We may do it some day if we find an easy way that won't clutter the code too much.
    • Constructor Detail

      • ExecutorNettyAdapter

        public ExecutorNettyAdapter​(ArtemisExecutor executor)
    • Method Detail

      • parent

        public io.netty.channel.EventLoopGroup parent()
        Specified by:
        parent in interface io.netty.util.concurrent.EventExecutor
        Specified by:
        parent in interface io.netty.channel.EventLoop
      • next

        public io.netty.channel.EventLoop next()
        Specified by:
        next in interface io.netty.util.concurrent.EventExecutor
        Specified by:
        next in interface io.netty.util.concurrent.EventExecutorGroup
        Specified by:
        next in interface io.netty.channel.EventLoopGroup
      • register

        public io.netty.channel.ChannelFuture register​(io.netty.channel.Channel channel)
        Specified by:
        register in interface io.netty.channel.EventLoopGroup
      • register

        public io.netty.channel.ChannelFuture register​(io.netty.channel.ChannelPromise promise)
        Specified by:
        register in interface io.netty.channel.EventLoopGroup
      • register

        public io.netty.channel.ChannelFuture register​(io.netty.channel.Channel channel,
                                                       io.netty.channel.ChannelPromise promise)
        Specified by:
        register in interface io.netty.channel.EventLoopGroup
      • inEventLoop

        public boolean inEventLoop()
        Specified by:
        inEventLoop in interface io.netty.util.concurrent.EventExecutor
      • inEventLoop

        public boolean inEventLoop​(Thread thread)
        Specified by:
        inEventLoop in interface io.netty.util.concurrent.EventExecutor
      • newPromise

        public <V> io.netty.util.concurrent.Promise<V> newPromise()
        Specified by:
        newPromise in interface io.netty.util.concurrent.EventExecutor
      • newProgressivePromise

        public <V> io.netty.util.concurrent.ProgressivePromise<V> newProgressivePromise()
        Specified by:
        newProgressivePromise in interface io.netty.util.concurrent.EventExecutor
      • newSucceededFuture

        public <V> io.netty.util.concurrent.Future<V> newSucceededFuture​(V result)
        Specified by:
        newSucceededFuture in interface io.netty.util.concurrent.EventExecutor
      • newFailedFuture

        public <V> io.netty.util.concurrent.Future<V> newFailedFuture​(Throwable cause)
        Specified by:
        newFailedFuture in interface io.netty.util.concurrent.EventExecutor
      • isShuttingDown

        public boolean isShuttingDown()
        Specified by:
        isShuttingDown in interface io.netty.util.concurrent.EventExecutorGroup
      • shutdownGracefully

        public io.netty.util.concurrent.Future<?> shutdownGracefully()
        Specified by:
        shutdownGracefully in interface io.netty.util.concurrent.EventExecutorGroup
      • shutdownGracefully

        public io.netty.util.concurrent.Future<?> shutdownGracefully​(long quietPeriod,
                                                                     long timeout,
                                                                     TimeUnit unit)
        Specified by:
        shutdownGracefully in interface io.netty.util.concurrent.EventExecutorGroup
      • terminationFuture

        public io.netty.util.concurrent.Future<?> terminationFuture()
        Specified by:
        terminationFuture in interface io.netty.util.concurrent.EventExecutorGroup
      • shutdown

        public void shutdown()
        Specified by:
        shutdown in interface io.netty.util.concurrent.EventExecutorGroup
        Specified by:
        shutdown in interface ExecutorService
      • shutdownNow

        public List<Runnable> shutdownNow()
        Specified by:
        shutdownNow in interface io.netty.util.concurrent.EventExecutorGroup
        Specified by:
        shutdownNow in interface ExecutorService
      • iterator

        public Iterator<io.netty.util.concurrent.EventExecutor> iterator()
        Specified by:
        iterator in interface io.netty.util.concurrent.EventExecutorGroup
        Specified by:
        iterator in interface Iterable<io.netty.util.concurrent.EventExecutor>
      • submit

        public io.netty.util.concurrent.Future<?> submit​(Runnable task)
        Specified by:
        submit in interface io.netty.util.concurrent.EventExecutorGroup
        Specified by:
        submit in interface ExecutorService
      • submit

        public <T> io.netty.util.concurrent.Future<T> submit​(Runnable task,
                                                             T result)
        Specified by:
        submit in interface io.netty.util.concurrent.EventExecutorGroup
        Specified by:
        submit in interface ExecutorService
      • submit

        public <T> io.netty.util.concurrent.Future<T> submit​(Callable<T> task)
        Specified by:
        submit in interface io.netty.util.concurrent.EventExecutorGroup
        Specified by:
        submit in interface ExecutorService
      • schedule

        public io.netty.util.concurrent.ScheduledFuture<?> schedule​(Runnable command,
                                                                    long delay,
                                                                    TimeUnit unit)
        Specified by:
        schedule in interface io.netty.util.concurrent.EventExecutorGroup
        Specified by:
        schedule in interface ScheduledExecutorService
      • schedule

        public <V> io.netty.util.concurrent.ScheduledFuture<V> schedule​(Callable<V> callable,
                                                                        long delay,
                                                                        TimeUnit unit)
        Specified by:
        schedule in interface io.netty.util.concurrent.EventExecutorGroup
        Specified by:
        schedule in interface ScheduledExecutorService
      • scheduleAtFixedRate

        public io.netty.util.concurrent.ScheduledFuture<?> scheduleAtFixedRate​(Runnable command,
                                                                               long initialDelay,
                                                                               long period,
                                                                               TimeUnit unit)
        Specified by:
        scheduleAtFixedRate in interface io.netty.util.concurrent.EventExecutorGroup
        Specified by:
        scheduleAtFixedRate in interface ScheduledExecutorService
      • scheduleWithFixedDelay

        public io.netty.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay​(Runnable command,
                                                                                  long initialDelay,
                                                                                  long delay,
                                                                                  TimeUnit unit)
        Specified by:
        scheduleWithFixedDelay in interface io.netty.util.concurrent.EventExecutorGroup
        Specified by:
        scheduleWithFixedDelay in interface ScheduledExecutorService