All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.baidu.disconf.client.addons.properties.ReloadConfiguration Maven / Gradle / Ivy

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