}
// set connect timeout to mina in seconds
connectorConfig.setConnectTimeout((int) (timeout / 1000));
// acceptor connectorConfig
SocketAcceptorConfig acceptorConfig = new SocketAcceptorConfig();
// must use manual thread model according to Mina documentation
acceptorConfig.setThreadModel(ThreadModel.MANUAL);
configureCodecFactory("MinaConsumer", acceptorConfig, configuration);
acceptorConfig.setReuseAddress(true);
acceptorConfig.setDisconnectOnUnbind(true);
acceptorConfig.getFilterChain().addLast("threadPool", new ExecutorFilter(Executors.newCachedThreadPool()));
if (minaLogger) {
acceptorConfig.getFilterChain().addLast("logger", new LoggingFilter());
}
MinaEndpoint endpoint = new MinaEndpoint(uri, this);
endpoint.setAddress(address);
endpoint.setAcceptor(acceptor);