}
// Create I/O and Protocol thread pool filter.
// I/O thread pool performs encoding and decoding of messages.
// Protocol thread pool performs actual protocol flow.
ThreadPoolFilter ioThreadPoolFilter = new ThreadPoolFilter();
ThreadPoolFilter protocolThreadPoolFilter = new ThreadPoolFilter();
IoConnector connector = new SocketConnector();
connector.getDefaultConfig().getFilterChain().addFirst(
"ioThreadPool", ioThreadPoolFilter );
connector.getDefaultConfig().getFilterChain().addLast(
"protocolThreadPool", protocolThreadPoolFilter );