Skip to content

Commit

Permalink
重构 ServiceBean 的 isDelay 方法,使其更符合语义 (apache#2686)
Browse files Browse the repository at this point in the history
* Refactor method isDelay of ServiceBean to fix the wrong meaning of the method

* Remove unnecessary method isDelay of ServiceBean
  • Loading branch information
code4wt authored and CrazyHZM committed Dec 6, 2018
1 parent bcc6150 commit 01cef05
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,14 @@ public Service getService() {

@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
if (isDelay() && !isExported() && !isUnexported()) {
if (!isExported() && !isUnexported()) {
if (logger.isInfoEnabled()) {
logger.info("The service ready on spring started. service: " + getInterface());
}
export();
}
}

private boolean isDelay() {
Integer delay = getDelay();
ProviderConfig provider = getProvider();
if (delay == null && provider != null) {
delay = provider.getDelay();
}
return supportedApplicationListener && (delay == null || delay == -1);
}

@Override
@SuppressWarnings({"unchecked", "deprecation"})
public void afterPropertiesSet() throws Exception {
Expand Down Expand Up @@ -251,7 +242,7 @@ && getInterface() != null && getInterface().length() > 0
setPath(beanName);
}
}
if (!isDelay()) {
if (!supportedApplicationListener) {
export();
}
}
Expand Down

0 comments on commit 01cef05

Please sign in to comment.