Skip to content

Commit b444220

Browse files
committed
SPR-5507 When determining start/stop order, the DefaultLifecycleProcessor checks for the new Phased interface rather than SmartLifecycle now.
1 parent 57f0a7d commit b444220

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

org.springframework.context/src/main/java/org/springframework/context/support/DefaultLifecycleProcessor.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
3434
import org.springframework.context.Lifecycle;
3535
import org.springframework.context.LifecycleProcessor;
36+
import org.springframework.context.Phased;
3637
import org.springframework.context.SmartLifecycle;
3738
import org.springframework.util.Assert;
3839

@@ -220,8 +221,8 @@ private Map<String, Lifecycle> getLifecycleBeans() {
220221
}
221222

222223
private static int getPhase(Lifecycle bean) {
223-
return (bean instanceof SmartLifecycle) ?
224-
((SmartLifecycle) bean).getPhase() : 0;
224+
return (bean instanceof Phased) ?
225+
((Phased) bean).getPhase() : 0;
225226
}
226227

227228

0 commit comments

Comments
 (0)