// connector config
SocketConnectorConfig connectorConfig = new SocketConnectorConfig();
configureSocketCodecFactory("MinaProducer", connectorConfig, textline, encoding, codec);
if (minaLogger) {
connectorConfig.getFilterChain().addLast("logger", new LoggingFilter());
}
// set connect timeout to mina in seconds
long connectTimeout = timeout > 0 ? timeout : DEFAULT_CONNECT_TIMEOUT;
connectorConfig.setConnectTimeout((int)(connectTimeout / 1000));
// acceptor connectorConfig
SocketAcceptorConfig acceptorConfig = new SocketAcceptorConfig();
configureSocketCodecFactory("MinaConsumer", acceptorConfig, textline, encoding, codec);
acceptorConfig.setReuseAddress(true);
acceptorConfig.setDisconnectOnUnbind(true);
if (minaLogger) {
acceptorConfig.getFilterChain().addLast("logger", new LoggingFilter());
}
MinaEndpoint endpoint = new MinaEndpoint(uri, this, address, acceptor, acceptorConfig, connector, connectorConfig, lazySessionCreation, timeout, transferExchange, sync);
if (encoding != null) {
endpoint.setCharsetName(getEncodingParameter("MinaProducer", encoding).name());