Skip to content

Commit

Permalink
feat: support RepositoryChangeListener for SPI
Browse files Browse the repository at this point in the history
提供SPI扩展,以便具体项目通过此SPI中来实现敏感信息(如密码)的解密处理

SPI实现类配置文件位置:META-INF\services\com.ctrip.framework.apollo.internals.RepositoryChangeListener
  • Loading branch information
qxo committed Aug 10, 2021
1 parent 2c9b4dc commit c416112
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public RemoteConfigRepository(String namespace) {
m_configNeedForceRefresh = new AtomicBoolean(true);
m_loadConfigFailSchedulePolicy = new ExponentialSchedulePolicy(m_configUtil.getOnErrorRetryInterval(),
m_configUtil.getOnErrorRetryInterval() * 8);
final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
ServiceLoader<RepositoryChangeListener> spiList = ServiceLoader.load(RepositoryChangeListener.class,classLoader);
for (RepositoryChangeListener spi : spiList) {
addChangeListener(spi);
}
this.trySync();
this.schedulePeriodicRefresh();
this.scheduleLongPollingRefresh();
Expand Down

0 comments on commit c416112

Please sign in to comment.