Skip to content

Commit

Permalink
Using defined constants (#1356)
Browse files Browse the repository at this point in the history
  • Loading branch information
JAY-0905 authored Jun 13, 2024
1 parent d6e5564 commit 295b016
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public RefreshEventListener refreshEventListener(ContextRefresher contextRefresh
return new RefreshEventListener(contextRefresher);
}

@ConfigurationProperties("spring.cloud.refresh")
@ConfigurationProperties(REFRESH_SCOPE_PREFIX)
public static class RefreshProperties {

/**
Expand Down Expand Up @@ -219,7 +219,7 @@ public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) t
if (isApplicable(registry, name, definition)) {
BeanDefinitionHolder holder = new BeanDefinitionHolder(definition, name);
BeanDefinitionHolder proxy = ScopedProxyUtils.createScopedProxy(holder, registry, true);
definition.setScope("refresh");
definition.setScope(REFRESH_SCOPE_NAME);
if (registry.containsBeanDefinition(proxy.getBeanName())) {
registry.removeBeanDefinition(proxy.getBeanName());
}
Expand Down Expand Up @@ -252,7 +252,7 @@ private void bindEnvironmentIfNeeded(BeanDefinitionRegistry registry) {
if (this.environment == null) {
this.environment = new StandardEnvironment();
}
Binder.get(this.environment).bind("spring.cloud.refresh", Bindable.ofInstance(this));
Binder.get(this.environment).bind(REFRESH_SCOPE_PREFIX, Bindable.ofInstance(this));
this.bound = true;
}
}
Expand Down

0 comments on commit 295b016

Please sign in to comment.