protected MinaEndpoint createVmEndpoint(String uri, MinaConfiguration configuration) {
boolean minaLogger = configuration.isMinaLogger();
boolean sync = configuration.isSync();
List<IoFilter> filters = configuration.getFilters();
IoAcceptor acceptor = new VmPipeAcceptor();
SocketAddress address = new VmPipeAddress(configuration.getPort());
IoConnector connector = new VmPipeConnector();
// connector config
configureCodecFactory("MinaProducer", connector.getDefaultConfig(), configuration);
if (minaLogger) {
connector.getFilterChain().addLast("logger", new LoggingFilter());
}
appendIoFiltersToChain(filters, connector.getFilterChain());
// acceptor connectorConfig
configureCodecFactory("MinaConsumer", acceptor.getDefaultConfig(), configuration);
if (minaLogger) {
acceptor.getFilterChain().addLast("logger", new LoggingFilter());
}
appendIoFiltersToChain(filters, acceptor.getFilterChain());
MinaEndpoint endpoint = new MinaEndpoint(uri, this);
endpoint.setAddress(address);
endpoint.setAcceptor(acceptor);
endpoint.setConnector(connector);