}
shutdownTacker.stop();
}
protected DetectingGateway createDetectingGateway() {
DetectingGateway gateway = new DetectingGateway();
ArrayList<Protocol> protocols = new ArrayList<Protocol>();
if( isStompEnabled() ) {
protocols.add(new StompProtocol());
}
if( isMqttEnabled() ) {
protocols.add(new MqttProtocol());
}
if( isAmqpEnabled() ) {
protocols.add(new AmqpProtocol());
}
if( isOpenWireEnabled() ) {
protocols.add(new OpenwireProtocol());
}
if( isHttpEnabled() ) {
protocols.add(new HttpProtocol());
}
if( isSslEnabled() ) {
SslConfig sslConfig = new SslConfig();
if( Strings.isNotBlank(sslAlgorithm) ) {
sslConfig.setAlgorithm(sslAlgorithm);
}
if( Strings.isNotBlank(keyAlias) ) {
sslConfig.setKeyAlias(keyAlias);
}
if( Strings.isNotBlank(keyPassword) ) {
sslConfig.setKeyPassword(keyPassword);
}
if( Strings.isNotBlank(keyStorePassword) ) {
sslConfig.setKeyStorePassword(keyStorePassword);
}
if( keyStoreURL!=null ) {
sslConfig.setKeyStoreURL(keyStoreURL);
}
if( Strings.isNotBlank(sslProtocol) ) {
sslConfig.setProtocol(sslProtocol);
}
if( Strings.isNotBlank(sslStoreType) ) {
sslConfig.setStoreType(sslStoreType);
}
if( Strings.isNotBlank(trustStorePassword) ) {
sslConfig.setTrustStorePassword(trustStorePassword);
}
if( trustStoreURL != null ) {
sslConfig.setTrustStoreURL(trustStoreURL);
}
if( Strings.isNotBlank(enabledCipherSuites) ) {
sslConfig.setEnabledCipherSuites(enabledCipherSuites);
}
if( Strings.isNotBlank(disabledCypherSuites) ) {
sslConfig.setDisabledCypherSuites(disabledCypherSuites);
}
gateway.setSslConfig(sslConfig);
protocols.add(new SslProtocol());
}
if (protocols.isEmpty()) {
return null;
}
VertxService vertxService = getVertxService();
LoadBalancer serviceLoadBalancer = LoadBalancers.createLoadBalancer(loadBalancerType, stickyLoadBalancerCacheSize);
gateway.setVertx(vertxService.getVertx());
gateway.setPort(port);
gateway.setServiceMap(serviceMap);
gateway.setProtocols(protocols);
gateway.setShutdownTacker(shutdownTacker);
gateway.setServiceLoadBalancer(serviceLoadBalancer);
gateway.setDefaultVirtualHost(defaultVirtualHost);
return gateway;
}