use of org.apache.mina.transport.vmpipe.VmPipeAcceptor in project camel by apache.
the class MinaComponent method createVmEndpoint.
// Implementation methods
//-------------------------------------------------------------------------
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);
endpoint.setConfiguration(configuration);
// set sync or async mode after endpoint is created
if (sync) {
endpoint.setExchangePattern(ExchangePattern.InOut);
} else {
endpoint.setExchangePattern(ExchangePattern.InOnly);
}
return endpoint;
}
use of org.apache.mina.transport.vmpipe.VmPipeAcceptor in project camel by apache.
the class Mina2Consumer method setupVmProtocol.
// Implementation methods
//-------------------------------------------------------------------------
protected void setupVmProtocol(String uri, Mina2Configuration configuration) {
boolean minaLogger = configuration.isMinaLogger();
List<IoFilter> filters = configuration.getFilters();
address = new VmPipeAddress(configuration.getPort());
acceptor = new VmPipeAcceptor();
// acceptor connectorConfig
configureCodecFactory("Mina2Consumer", acceptor, configuration);
if (minaLogger) {
acceptor.getFilterChain().addLast("logger", new LoggingFilter());
}
appendIoFiltersToChain(filters, acceptor.getFilterChain());
if (configuration.getSslContextParameters() != null) {
LOG.warn("Using vm protocol" + ", but an SSLContextParameters instance was provided. SSLContextParameters is only supported on the TCP protocol.");
}
}
Aggregations