String value = properties.getProperty(key);
if (key.startsWith(PREFIX)) {
int a = key.indexOf(DOT);
if (a == -1) {
throw new ProxoolException("Property " + key + " must be of the format " + EXAMPLE_FORMAT);
}
final String tag = key.substring(0, a);
final String name = key.substring(a + 1);
proxoolProperties = (Properties) propertiesMap.get(tag);
if (proxoolProperties == null) {
proxoolProperties = new Properties();
propertiesMap.put(tag, proxoolProperties);
}
proxoolProperties.put(name, value);
}
}
final Iterator tags = propertiesMap.keySet().iterator();
while (tags.hasNext()) {
proxoolProperties = (Properties) propertiesMap.get(tags.next());
// make sure that required propeties are defined
// and build the url
// Check that we have defined the minimum information
final String driverClass = proxoolProperties.getProperty(ProxoolConstants.DRIVER_CLASS_PROPERTY);
final String driverUrl = proxoolProperties.getProperty(ProxoolConstants.DRIVER_URL_PROPERTY);
if (driverClass == null || driverUrl == null) {
throw new ProxoolException("You must define the " + ProxoolConstants.DRIVER_CLASS_PROPERTY + " and the "
+ ProxoolConstants.DRIVER_URL_PROPERTY + ".");
}
final String alias = proxoolProperties.getProperty(ProxoolConstants.ALIAS_PROPERTY);
// Build the URL; optionally defining a name