Class ChainedExecutor
- java.lang.Object
-
- org.jboss.netty.handler.execution.ChainedExecutor
-
- All Implemented Interfaces:
Executor,ExternalResourceReleasable
public class ChainedExecutor extends Object implements Executor, ExternalResourceReleasable
-
-
Constructor Summary
Constructors Constructor Description ChainedExecutor(ChannelEventRunnableFilter filter, Executor cur, Executor next)Create a newChainedExecutorwhich will used the givenChannelEventRunnableFilterto see if thecurExecutorshould get used.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(Runnable command)Execute the passedChannelEventRunnablewith the currentExecutorif theChannelEventRunnableFiltermatch.voidreleaseExternalResources()Releases the external resources that this object depends on.
-
-
-
Constructor Detail
-
ChainedExecutor
public ChainedExecutor(ChannelEventRunnableFilter filter, Executor cur, 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(Runnable command)
Execute the passedChannelEventRunnablewith the currentExecutorif theChannelEventRunnableFiltermatch. Otherwise pass it to the nextExecutorin the chain.
-
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
-
-