Class ChainedExecutor
- java.lang.Object
-
- org.jboss.netty.handler.execution.ChainedExecutor
-
- All Implemented Interfaces:
java.util.concurrent.Executor,ExternalResourceReleasable
public class ChainedExecutor extends java.lang.Object implements java.util.concurrent.Executor, ExternalResourceReleasable
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.Executorcurprivate ChannelEventRunnableFilterfilterprivate java.util.concurrent.Executornext
-
Constructor Summary
Constructors Constructor Description ChainedExecutor(ChannelEventRunnableFilter filter, java.util.concurrent.Executor cur, java.util.concurrent.Executor next)Create a newChainedExecutorwhich will used the givenChannelEventRunnableFilterto see if thecurExecutorshould get used.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(java.lang.Runnable command)Execute the passedChannelEventRunnablewith the currentExecutorif theChannelEventRunnableFiltermatch.private static voidreleaseExternal(java.util.concurrent.Executor executor)voidreleaseExternalResources()Releases the external resources that this object depends on.
-
-
-
Field Detail
-
cur
private final java.util.concurrent.Executor cur
-
next
private final java.util.concurrent.Executor next
-
filter
private final ChannelEventRunnableFilter filter
-
-
Constructor Detail
-
ChainedExecutor
public ChainedExecutor(ChannelEventRunnableFilter filter, java.util.concurrent.Executor cur, java.util.concurrent.Executor next)
Create a newChainedExecutorwhich will used the givenChannelEventRunnableFilterto see if thecurExecutorshould get used. Otherwise it will pass the work to thenextExecutor- Parameters:
filter- theChannelEventRunnableFilterwhich will be used to check if theChannelEventRunnableshould be passed to the cur or nextExecutorcur- theExecutorto use if theChannelEventRunnableFiltermatchnext- theExecutorto use if theChannelEventRunnableFilterdoes not match
-
-
Method Detail
-
execute
public void execute(java.lang.Runnable command)
Execute the passedChannelEventRunnablewith the currentExecutorif theChannelEventRunnableFiltermatch. Otherwise pass it to the nextExecutorin the chain.- Specified by:
executein interfacejava.util.concurrent.Executor
-
releaseExternalResources
public void releaseExternalResources()
Description copied from interface:ExternalResourceReleasableReleases the external resources that this object depends on. You should not call this method if the external resources (e.g. thread pool) are in use by other objects.- Specified by:
releaseExternalResourcesin interfaceExternalResourceReleasable
-
releaseExternal
private static void releaseExternal(java.util.concurrent.Executor executor)
-
-