zoukankan      html  css  js  c++  java
  • geoserver之GeoServerEnvironment&GeoServerExtensions&GeoServerResourceLoader类

    简介: Utility class uses to process GeoServer configuration workflow through external environment variables. This class must be used everytime we need to resolve a configuration placeholder at runtime. An instance of this class needs to be registered in spring context as follows. bean id="geoserverEnvironment" class="org.geoserver.GeoServerEnvironment" depends-on="extensions"/&gt;</code> </pre> It must be a singleton, and must not be loaded lazily. Furthermore, this bean must be loaded  before any beans that use it.  @author Alessio Fabiani, GeoSolutions

    简介:实用程序类用于通过外部环境变量处理GeoServer配置工作流。每当我们需要在运行时解析配置占位符时,都必须使用该类。这个类的一个实例需要在spring上下文中注册,如下所示。<bean id="geoserverEnvironment" class="org.geoserver.GeoServerEnvironment" depends-on="extensions"/>。它必须是单例,并且不能延迟加载。此外,这个bean必须在任何使用它的bean之前加载@作者Alessio Fabiani,GeoSolutions

    成员:

       protected static final Logger LOGGER

       private static final Constants constants

    通过系统环境设置变量,以指示GeoServer使用或不使用配置占位符转换。 默认为FALSE。

    通过系统环境返回变量集,以指示GeoServer使用或不使用配置占位符转换。

    通过系统环境重新加载变量集,以指示GeoServer使用或不使用配置占位符转换。此同步方法仅用于测试目的。

    构造函数:

    public GeoServerEnvironment() {
    try {
    GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class);
    configFile = new FileWatcher<Properties>(loader.get(PROPERTYFILENAME)) {
    @Override
    protected Properties parseFileContents(InputStream in) throws IOException {
    Properties p = new Properties();
    p.load(in);
    return p;
    }
    };
    props = configFile.read();
    } catch (Exception e) {
    LOGGER.log(
    Level.WARNING,
    "Could not find any '" + PROPERTYFILENAME + "' property file.",
    e);
    props = new Properties();
    }
    }

    GeoServerExtensions实现了ApplicationContextAware接口,可以获取上下文中spring管理的bean

    简介:Utility class uses to process GeoServer extension points. An instance of this class needs to be registered in spring context as follows.<bean id="geoserverExtensions" class="org.geoserver.GeoServerExtensions"/>. It must be a singleton, and must not be loaded lazily. Furthermore, this bean must be loaded * before any beans that use it.

    简介:用来处理GeoServer扩展点的实用类。该类的实例需要在spring上下文中按照如下进行注册。<bean id="geoserverExtensions" class="org.geoserver.GeoServerExtensions"/>。它必须是单例,并且不能延迟加载。此外,这个bean必须在任何使用它的bean之前加载。

    方法:

      setApplicationContext(ApplicationContext ac)

      extensions(Class<T> ep, ApplicationContext ac) //Loads all extensions implementing or extending <code>extensionPoint</code>加载所有继承或者实现了extensionPoint的扩展

                                                                                   //参数1:extensionPoint。The class or interface of the extensions.扩展的类或接口。

                                                                                   //参数2:context The context in which to perform the lookup.要执行查找的上下文。

                                                                                   //返回值:A collection of the extensions, or an empty collection.一系列的扩展,或者空集合。

    >>factory spi是什么:https://blog.csdn.net/zw3413/article/details/84144405

    FactorySPI是一个运行时额插件系统,因此你的程序可以发现和使用任何服务。

    FactoryRegistry是全局唯一的单例对象,因此建议将它保存在全局服务例如JNDI或者Spirng上下文中

    >>扩展点加载机制(ExtensionLoader):https://blog.csdn.net/jdluojing/article/details/44947221 dubbo:link

    >>SpringBoot应用篇之FactoryBean及代理实现SPI机制示例:https://blog.csdn.net/weixin_33859665/article/details/88001041

    GeoServerResourceLoader:访问GeoServer中的资源,包括配置信息和非托管缓存或日志文件。

  • 相关阅读:
    《DSP using MATLAB》Problem 6.17
    一些老物件
    《DSP using MATLAB》Problem 6.16
    《DSP using MATLAB》Problem 6.15
    《DSP using MATLAB》Problem 6.14
    《DSP using MATLAB》Problem 6.13
    《DSP using MATLAB》Problem 6.12
    《DSP using MATLAB》Problem 6.11
    P1414 又是毕业季II
    Trie树
  • 原文地址:https://www.cnblogs.com/2008nmj/p/15813871.html
Copyright © 2011-2022 走看看