TeiidURL url;
try {
url = new TeiidURL(connectionProperties.getProperty(TeiidURL.CONNECTION.SERVER_URL));
} catch (MalformedURLException e1) {
throw new ConnectionException(e1);
}
String discoveryStrategyName = connectionProperties.getProperty(TeiidURL.CONNECTION.DISCOVERY_STRATEGY, URL);
ServerDiscovery discovery;
if (URL.equalsIgnoreCase(discoveryStrategyName)) {
discovery = new UrlServerDiscovery();
} else {
try {
discovery = (ServerDiscovery)ReflectionHelper.create(discoveryStrategyName, null, this.getClass().getClassLoader());
} catch (TeiidException e) {
throw new ConnectionException(e);
}
}
discovery.init(url, connectionProperties);