netty3.6.6的DefaultChannelPipeline对象内有依赖个sink。
org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink
/**
* Receives and processes the terminal downstream {@link ChannelEvent}s.
* <p>
* A {@link ChannelSink} is an internal component which is supposed to be
* implemented by a transport provider. Most users will not see this type
* in their code.
*
* @apiviz.uses org.jboss.netty.channel.ChannelPipeline - - sends events upstream
*/
public interface ChannelSink {
/**
* Invoked by {@link ChannelPipeline} when a downstream {@link ChannelEvent}
* has reached its terminal (the head of the pipeline). 下游调用中断
*/
void eventSunk(ChannelPipeline pipeline, ChannelEvent e) throws Exception;
/**
* Invoked by {@link ChannelPipeline} when an exception was raised while
* one of its {@link ChannelHandler}s process a {@link ChannelEvent}. 出现异常引起处理器链中端
*/
void exceptionCaught(ChannelPipeline pipeline, ChannelEvent e, ChannelPipelineException cause) throws Exception;
/**
* Execute the given {@link Runnable} later in the io-thread. 执行异步任务
* Some implementation may not support this and just execute it directly.
*/
ChannelFuture execute(ChannelPipeline pipeline, Runnable task);
}