Class ThreadExecutorMap


  • public final class ThreadExecutorMap
    extends java.lang.Object
    Allow to retrieve the EventExecutor for the calling Thread.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Runnable apply​(java.lang.Runnable command, EventExecutor eventExecutor)
      Decorate the given Runnable and ensure currentExecutor() will return eventExecutor when called from within the Runnable during execution.
      static java.util.concurrent.Executor apply​(java.util.concurrent.Executor executor, EventExecutor eventExecutor)
      Decorate the given Executor and ensure currentExecutor() will return eventExecutor when called from within the Runnable during execution.
      static java.util.concurrent.ThreadFactory apply​(java.util.concurrent.ThreadFactory threadFactory, EventExecutor eventExecutor)
      Decorate the given ThreadFactory and ensure currentExecutor() will return eventExecutor when called from within the Runnable during execution.
      static EventExecutor currentExecutor()
      Returns the current EventExecutor that uses the Thread, or null if none / unknown.
      static EventExecutor setCurrentExecutor​(EventExecutor executor)
      Set the current EventExecutor that is used by the Thread.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • currentExecutor

        public static EventExecutor currentExecutor()
        Returns the current EventExecutor that uses the Thread, or null if none / unknown.
      • apply

        public static java.util.concurrent.Executor apply​(java.util.concurrent.Executor executor,
                                                          EventExecutor eventExecutor)
        Decorate the given Executor and ensure currentExecutor() will return eventExecutor when called from within the Runnable during execution.
      • apply

        public static java.lang.Runnable apply​(java.lang.Runnable command,
                                               EventExecutor eventExecutor)
        Decorate the given Runnable and ensure currentExecutor() will return eventExecutor when called from within the Runnable during execution.
      • apply

        public static java.util.concurrent.ThreadFactory apply​(java.util.concurrent.ThreadFactory threadFactory,
                                                               EventExecutor eventExecutor)
        Decorate the given ThreadFactory and ensure currentExecutor() will return eventExecutor when called from within the Runnable during execution.