
com.baidu.disconf.client.addons.properties.ReloadConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of disconf-client Show documentation
Show all versions of disconf-client Show documentation
https://github.com/knightliao/disconf/tree/master/disconf-client
The newest version!
package com.baidu.disconf.client.addons.properties;
import java.util.ArrayList;
import java.util.List;
/**
* 线程方式的reload
*/
public class ReloadConfiguration implements Runnable {
List reconfigurableBeans;
public void setReconfigurableBeans(List reconfigurableBeans) {
// early type check, and avoid aliassing
this.reconfigurableBeans = new ArrayList();
for (Object o : reconfigurableBeans) {
this.reconfigurableBeans.add((ReconfigurableBean) o);
}
}
public void run() {
for (ReconfigurableBean bean : reconfigurableBeans) {
try {
bean.reloadConfiguration();
} catch (Exception e) {
throw new RuntimeException("while reloading configuration of " + bean, e);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy