Package io.netty.util.internal
Class ThreadExecutorMap
- java.lang.Object
-
- io.netty.util.internal.ThreadExecutorMap
-
public final class ThreadExecutorMap extends java.lang.Object
Allow to retrieve theEventExecutor
for the callingThread
.
-
-
Field Summary
Fields Modifier and Type Field Description private static FastThreadLocal<EventExecutor>
mappings
-
Constructor Summary
Constructors Modifier Constructor Description private
ThreadExecutorMap()
-
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 givenRunnable
and ensurecurrentExecutor()
will returneventExecutor
when called from within theRunnable
during execution.static java.util.concurrent.Executor
apply(java.util.concurrent.Executor executor, EventExecutor eventExecutor)
Decorate the givenExecutor
and ensurecurrentExecutor()
will returneventExecutor
when called from within theRunnable
during execution.static java.util.concurrent.ThreadFactory
apply(java.util.concurrent.ThreadFactory threadFactory, EventExecutor eventExecutor)
Decorate the givenThreadFactory
and ensurecurrentExecutor()
will returneventExecutor
when called from within theRunnable
during execution.static EventExecutor
currentExecutor()
private static void
setCurrentEventExecutor(EventExecutor executor)
Set the currentEventExecutor
that is used by theThread
.
-
-
-
Field Detail
-
mappings
private static final FastThreadLocal<EventExecutor> mappings
-
-
Method Detail
-
currentExecutor
public static EventExecutor currentExecutor()
-
setCurrentEventExecutor
private static void setCurrentEventExecutor(EventExecutor executor)
Set the currentEventExecutor
that is used by theThread
.
-
apply
public static java.util.concurrent.Executor apply(java.util.concurrent.Executor executor, EventExecutor eventExecutor)
Decorate the givenExecutor
and ensurecurrentExecutor()
will returneventExecutor
when called from within theRunnable
during execution.
-
apply
public static java.lang.Runnable apply(java.lang.Runnable command, EventExecutor eventExecutor)
Decorate the givenRunnable
and ensurecurrentExecutor()
will returneventExecutor
when called from within theRunnable
during execution.
-
apply
public static java.util.concurrent.ThreadFactory apply(java.util.concurrent.ThreadFactory threadFactory, EventExecutor eventExecutor)
Decorate the givenThreadFactory
and ensurecurrentExecutor()
will returneventExecutor
when called from within theRunnable
during execution.
-
-