简介: 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"/></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中的资源,包括配置信息和非托管缓存或日志文件。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
2019-01-17 NAOQI API之学习笔记
2019-01-17 ros kinect calibration