public class ChainedExecutor extends java.lang.Object implements java.util.concurrent.Executor, ExternalResourceReleasable
| Modifier and Type | Field and Description |
|---|---|
private java.util.concurrent.Executor |
cur |
private ChannelEventRunnableFilter |
filter |
private java.util.concurrent.Executor |
next |
| Constructor and Description |
|---|
ChainedExecutor(ChannelEventRunnableFilter filter,
java.util.concurrent.Executor cur,
java.util.concurrent.Executor next)
Create a new
ChainedExecutor which will used the given
ChannelEventRunnableFilter to see if the cur Executor should get
used. |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(java.lang.Runnable command)
Execute the passed
ChannelEventRunnable with the current Executor if the
ChannelEventRunnableFilter match. |
private static void |
releaseExternal(java.util.concurrent.Executor executor) |
void |
releaseExternalResources()
Releases the external resources that this object depends on.
|
private final java.util.concurrent.Executor cur
private final java.util.concurrent.Executor next
private final ChannelEventRunnableFilter filter
public ChainedExecutor(ChannelEventRunnableFilter filter, java.util.concurrent.Executor cur, java.util.concurrent.Executor next)
ChainedExecutor which will used the given
ChannelEventRunnableFilter to see if the cur Executor should get
used. Otherwise it will pass the work to the next Executorfilter - the ChannelEventRunnableFilter which will be used to check if the
ChannelEventRunnable should be passed to the cur or next Executorcur - the Executor to use if the ChannelEventRunnableFilter matchnext - the Executor to use if the ChannelEventRunnableFilter does not matchpublic void execute(java.lang.Runnable command)
ChannelEventRunnable with the current Executor if the
ChannelEventRunnableFilter match. Otherwise pass it to the next Executor in
the chain.execute in interface java.util.concurrent.Executorpublic void releaseExternalResources()
ExternalResourceReleasablereleaseExternalResources in interface ExternalResourceReleasableprivate static void releaseExternal(java.util.concurrent.Executor executor)