Skip to content

Commit c8c5c3a

Browse files
HzjNeverStop致节
andauthored
fix StartupContextRefreshedListener order (#966)
Co-authored-by: 致节 <[email protected]>
1 parent 1e1ef0a commit c8c5c3a

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

sofa-boot-project/sofa-boot-core/startup-sofa-boot/src/main/java/com/alipay/sofa/startup/stage/StartupContextRefreshedListener.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
import org.springframework.context.ApplicationContext;
2626
import org.springframework.context.ApplicationContextAware;
2727
import org.springframework.context.SmartLifecycle;
28-
import org.springframework.core.Ordered;
29-
import org.springframework.core.PriorityOrdered;
3028

3129
import static com.alipay.sofa.boot.startup.BootStageConstants.APPLICATION_CONTEXT_REFRESH_STAGE;
3230

@@ -36,16 +34,10 @@
3634
* @author Zhijie
3735
* @since 2020/7/20
3836
*/
39-
public class StartupContextRefreshedListener implements SmartLifecycle, ApplicationContextAware,
40-
PriorityOrdered {
37+
public class StartupContextRefreshedListener implements SmartLifecycle, ApplicationContextAware {
4138
public static final String ROOT_MODULE_NAME = "ROOT_APPLICATION_CONTEXT";
4239
private ApplicationContext applicationContext;
4340

44-
@Override
45-
public int getOrder() {
46-
return Ordered.HIGHEST_PRECEDENCE;
47-
}
48-
4941
@Override
5042
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
5143
this.applicationContext = applicationContext;
@@ -91,4 +83,9 @@ public void stop() {
9183
public boolean isRunning() {
9284
return false;
9385
}
86+
87+
@Override
88+
public int getPhase() {
89+
return Integer.MIN_VALUE;
90+
}
9491
}

0 commit comments

Comments
 (0)