当前位置: 首页 > news >正文

重庆建设工程公司网站/百度seo排名360

重庆建设工程公司网站,百度seo排名360,做电影网站需要多大空间,亿网互联科技有限公司Archaius是什么? 一句话:可以动态的管理属性配置文件。使用相关的API使用属性就可以实现动态的数性加载。 参考自Getting-Started * 引入项目中* com.netflix.archaiusarchaius-…

Archaius是什么??
一句话:可以动态的管理属性配置文件。使用相关的API使用属性就可以实现动态的数性加载。?
参考自Getting-Started

* 引入项目中*

com.netflix.archaiusarchaius-core0.6.0
  • 1
  • 2
  • 3
  • 4
  • 5

使用本地配置文件作为配置源

  • 默认的,Archaius将查找classpath下名为config.properties文件并读取,这个配置文件可以使包含在一个jar包的根路径下。
  • 另外,你可以使用属性archaius.configurationSource.additionalUrls来包含url形式的文件,多个文件用逗号分割。

可以使用下面的API在程序中得到你需要的属性

 // create a property whose value is type long and use 1000 as the default // if the property is not definedDynamicLongProperty timeToWait = DynamicPropertyFactory.getInstance().getLongProperty("lock.waitTime", 1000);// ...ReentrantLock lock = ...;// ...lock.tryLock(timeToWait.get(), TimeUnit.MILLISECONDS); // timeToWait.get() returns up-to-date value of the property    
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8

默认的:Archaius会每一分钟去重新加载下属性配置?
注意:配置多属性文件时的属性覆盖,最后读到的属性会覆盖前面相同的属性

列出我们可以修改的一些系统属性

Operation HTTP?action Notes
archaius.configurationSource.defaultFileName 指定Archaius默认加载的配置源属性文件名,默认:classpath:config.properties config.properties
archaius.fixedDelayPollingScheduler.initialDelayMills 延迟加载,默认30秒 30000
archaius.fixedDelayPollingScheduler.delayMills 两次属性读取时间间隔,默认1分钟 60000

高级使用:自定义configuration source和polling scheduler,即自己设计动态属性配置方案。

相关文章:

  • 做电影网站有哪些/网络营销内容
  • 炫酷的网站开发/免费广告投放平台