zoukankan      html  css  js  c++  java
  • 自定义Spring ApplicationContext 支持动态订阅spring配置

    public class StringXmlApplicationContext extends AbstractXmlApplicationContext {

    private Resource[] configResources;

    public StringXmlApplicationContext(String stringXml) {

      this(new String[] { stringXml }, null);

    }

    public StringXmlApplicationContext(String[] stringXmls) {

      this(stringXmls, null);

    }

    public StringXmlApplicationContext(String[] stringXmls, ApplicationContext parent) {

      super(parent);

      this.configResources = new Resource[stringXmls.length];

      for (int i = 0; i < stringXmls.length; i++) {

        this.configResources[i] = new ByteArrayResource(stringXmls[i].getBytes());

      }

      refresh();

    }

    protected Resource[] getConfigResources() {

      return this.configResources;

    }

    public ClassLoader getClassLoader() { 

           return this.getClass().getClassLoader();

        }

    }

  • 相关阅读:
    C++中的类访问控制
    Docker应用程序容器技术_转
    16C554(8250)驱动分析
    动态调频DVFS_转
    ubifs概述
    ubifs物理存储
    fmt-重新格式化段落
    uniq-删除重复
    sort
    join用法
  • 原文地址:https://www.cnblogs.com/adealjason/p/6775264.html
Copyright © 2011-2022 走看看