@ -221,16 +221,27 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life
@@ -221,16 +221,27 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life
@ -1555,6 +1556,12 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
@@ -1555,6 +1556,12 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
@ -287,7 +287,7 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
@@ -287,7 +287,7 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
*/
@Override
publicvoidstop(){
stopBeans();
stopBeans(false);
this.running=false;
}
@ -308,7 +308,7 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
@@ -308,7 +308,7 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
catch(ApplicationContextExceptionex){
// Some bean failed to auto-start within context refresh:
// stop already started beans on context refresh failure.
stopBeans();
stopBeans(false);
throwex;
}
this.running=true;
@ -318,15 +318,23 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
@@ -318,15 +318,23 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
publicvoidonRestart(){
this.stoppedBeans=null;
if(this.running){
stopBeans();
stopBeans(true);
}
startBeans(true);
this.running=true;
}
@Override
publicvoidonPause(){
if(this.running){
stopBeans(true);
this.running=false;
}
}
@Override
publicvoidonClose(){
stopBeans();
stopBeans(false);
this.running=false;
}
@ -341,7 +349,7 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
@@ -341,7 +349,7 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
voidstopForRestart(){
if(this.running){
this.stoppedBeans=ConcurrentHashMap.newKeySet();
stopBeans();
stopBeans(false);
this.running=false;
}
}
@ -361,7 +369,8 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
@@ -361,7 +369,8 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
@ -424,13 +433,14 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
@@ -424,13 +433,14 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
@ -446,13 +456,13 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
@@ -446,13 +456,13 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
@ -461,6 +471,7 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
@@ -461,6 +471,7 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
stoppedBeans.add(beanName);
}
if(beaninstanceofSmartLifecyclesmartLifecycle){
if(!pauseableOnly||smartLifecycle.isPauseable()){
if(logger.isTraceEnabled()){
logger.trace("Asking bean '"+beanName+"' of type ["+
bean.getClass().getName()+"] to stop");
@ -474,7 +485,8 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
@@ -474,7 +485,8 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
}
});
}
else{
}
elseif(!pauseableOnly){
if(logger.isTraceEnabled()){
logger.trace("Stopping bean '"+beanName+"' of type ["+
bean.getClass().getName()+"]");
@ -562,14 +574,19 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
@@ -562,14 +574,19 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
@ -621,7 +638,7 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
@@ -621,7 +638,7 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
@ -187,7 +187,7 @@ public class DefaultContextCache implements ContextCache {
@@ -187,7 +187,7 @@ public class DefaultContextCache implements ContextCache {