• 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中的资源,包括配置信息和非托管缓存或日志文件。

  • 相关阅读:
    Installing Python Modules
    《利用Python 进行数据分析》
    使用Python进行描述性统计
    各种数字证书区别
    数字证书及CA的扫盲介绍
    expect学习笔记及实例详解
    使用openssl命令制作ecc证书
    那些证书相关的玩意儿(SSL,X.509,PEM,DER,CRT,CER,KEY,CSR,P12等)
    Openssl与私有CA搭建
    Openssl编程--源码分析
  • 原文地址:https://www.cnblogs.com/2008nmj/p/15813871.html
Copyright © 2020-2023  润新知