Archaius配置管理API
Archaius 包含一系列配置管理API,提供動態(tài)類型化屬性、線程安全配置操作、輪詢框架、回調(diào)機制等等功能。
Archaius 支持配置源包括:文件、URLs、JDBC 以及 Amazon DynamoDB
示例代碼:
// create a property whose value is type long and use 1000 as the default
// if the property is not defined
DynamicLongProperty 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評論
圖片
表情
