SPR-5507 When determining start/stop order, the DefaultLifecycleProcessor checks for the new Phased interface rather than SmartLifecycle now.
This commit is contained in:
parent
57f0a7d94b
commit
b444220564
|
|
@ -33,6 +33,7 @@ import org.springframework.beans.factory.BeanFactoryAware;
|
||||||
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
||||||
import org.springframework.context.Lifecycle;
|
import org.springframework.context.Lifecycle;
|
||||||
import org.springframework.context.LifecycleProcessor;
|
import org.springframework.context.LifecycleProcessor;
|
||||||
|
import org.springframework.context.Phased;
|
||||||
import org.springframework.context.SmartLifecycle;
|
import org.springframework.context.SmartLifecycle;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
|
|
@ -220,8 +221,8 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int getPhase(Lifecycle bean) {
|
private static int getPhase(Lifecycle bean) {
|
||||||
return (bean instanceof SmartLifecycle) ?
|
return (bean instanceof Phased) ?
|
||||||
((SmartLifecycle) bean).getPhase() : 0;
|
((Phased) bean).getPhase() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue