Fixed a wrong usage of ExecutionHandler in the example

This commit is contained in:
Trustin Lee 2010-04-06 09:40:35 +00:00
parent 8474026c92
commit cac77a47b2

View File

@ -37,17 +37,17 @@ import org.jboss.netty.handler.execution.ExecutionHandler;
*/
public class LocalServerPipelineFactory implements ChannelPipelineFactory {
private final Executor eventExecutor;
private final ExecutionHandler executionHandler;
public LocalServerPipelineFactory(Executor eventExecutor) {
this.eventExecutor = eventExecutor;
executionHandler = new ExecutionHandler(eventExecutor);
}
public ChannelPipeline getPipeline() throws Exception {
final ChannelPipeline pipeline = Channels.pipeline();
pipeline.addLast("decoder", new StringDecoder());
pipeline.addLast("encoder", new StringEncoder());
pipeline.addLast("executor", new ExecutionHandler(eventExecutor));
pipeline.addLast("executor", executionHandler);
pipeline.addLast("handler", new EchoCloseServerHandler());
return pipeline;
}