public void configure(String configuration) throws IOException {
HashMap<HttpProvider, Integer> newProviders = new HashMap<HttpProvider, Integer>();
for (StringTokenizer st = new StringTokenizer(configuration); st.hasMoreElements(); ) {
String host = st.nextToken();
int weight = Integer.parseInt(st.nextToken());
newProviders.put(new HttpProvider(new ConnectionString(host)), weight);
}
List<HttpProvider> oldProviders = replaceProviders(newProviders);
for (HttpProvider provider : oldProviders) {
provider.close();