mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-21 05:09:13 +00:00
SPR-5507 When determining start/stop order, the DefaultLifecycleProcessor checks for the new Phased interface rather than SmartLifecycle now.
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2534 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
+3
-2
@@ -33,6 +33,7 @@ import org.springframework.beans.factory.BeanFactoryAware;
|
||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||
import org.springframework.context.Lifecycle;
|
||||
import org.springframework.context.LifecycleProcessor;
|
||||
import org.springframework.context.Phased;
|
||||
import org.springframework.context.SmartLifecycle;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
@@ -220,8 +221,8 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
|
||||
}
|
||||
|
||||
private static int getPhase(Lifecycle bean) {
|
||||
return (bean instanceof SmartLifecycle) ?
|
||||
((SmartLifecycle) bean).getPhase() : 0;
|
||||
return (bean instanceof Phased) ?
|
||||
((Phased) bean).getPhase() : 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user