String keystorePath = serverConfig.getKeystorePath();
String keystorePassword = serverConfig.getKeystorePassword();
String certType = serverConfig.getCertType();
SSLContextFactory sslFactory = null;
if (!serverConfig.getSSLOnly())
{
for(int port : ports)
{
NetworkDriver driver = new MINANetworkDriver();
Set<VERSION> supported = new HashSet<VERSION>(ALL_VERSIONS);
if(exclude_0_10.contains(port))
{
supported.remove(VERSION.v0_10);
}
if(exclude_0_9_1.contains(port))
{
supported.remove(VERSION.v0_9_1);
}
if(exclude_0_9.contains(port))
{
supported.remove(VERSION.v0_9);
}
if(exclude_0_8.contains(port))
{
supported.remove(VERSION.v0_8);
}
MultiVersionProtocolEngineFactory protocolEngineFactory =
new MultiVersionProtocolEngineFactory(hostName, supported);
driver.bind(port, new InetAddress[]{bindAddress}, protocolEngineFactory,
serverConfig.getNetworkConfiguration(), null);
ApplicationRegistry.getInstance().addAcceptor(new InetSocketAddress(bindAddress, port),
new QpidAcceptor(driver,"TCP"));
CurrentActor.get().message(BrokerMessages.BRK_LISTENING("TCP", port));
}
}
if (serverConfig.getEnableSSL())
{
sslFactory = new SSLContextFactory(keystorePath, keystorePassword, certType);
NetworkDriver driver = new MINANetworkDriver();
driver.bind(serverConfig.getSSLPort(), new InetAddress[]{bindAddress},
new AMQProtocolEngineFactory(), serverConfig.getNetworkConfiguration(), sslFactory);
ApplicationRegistry.getInstance().addAcceptor(new InetSocketAddress(bindAddress, serverConfig.getSSLPort()),
new QpidAcceptor(driver,"TCP"));