Class ThreadExecutorMap

java.lang.Object
io.netty.util.internal.ThreadExecutorMap

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

    Fields
    Modifier and Type
    Field
    Description
    private static final FastThreadLocal<EventExecutor>
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    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.
    Returns the current EventExecutor that uses the Thread, or null if none / unknown.
    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
  • Field Details

  • Constructor Details

    • ThreadExecutorMap

      private ThreadExecutorMap()
  • Method Details

    • currentExecutor

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

      public static EventExecutor setCurrentExecutor(EventExecutor executor)
      Set the current EventExecutor that is used by the Thread.
    • 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.