File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
spring-context-support/src/test/java/org/springframework/scheduling/quartz
spring-context/src/main/java/org/springframework/context/support Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2009 the original author or authors.
2+ * Copyright 2002-2017 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
3030 */
3131public class QuartzSchedulerLifecycleTests {
3232
33- @ Test // SPR-6354
33+ @ Test // SPR-6354
3434 public void destroyLazyInitSchedulerWithDefaultShutdownOrderDoesNotHang () {
3535 AbstractApplicationContext context = new ClassPathXmlApplicationContext ("quartzSchedulerLifecycleTests.xml" , this .getClass ());
3636 assertNotNull (context .getBean ("lazyInitSchedulerWithDefaultShutdownOrder" ));
3737 StopWatch sw = new StopWatch ();
3838 sw .start ("lazyScheduler" );
39- context .destroy ();
39+ context .close ();
4040 sw .stop ();
4141 assertTrue ("Quartz Scheduler with lazy-init is hanging on destruction: " +
4242 sw .getTotalTimeMillis (), sw .getTotalTimeMillis () < 500 );
4343 }
4444
45- @ Test // SPR-6354
45+ @ Test // SPR-6354
4646 public void destroyLazyInitSchedulerWithCustomShutdownOrderDoesNotHang () {
4747 AbstractApplicationContext context = new ClassPathXmlApplicationContext ("quartzSchedulerLifecycleTests.xml" , this .getClass ());
4848 assertNotNull (context .getBean ("lazyInitSchedulerWithCustomShutdownOrder" ));
4949 StopWatch sw = new StopWatch ();
5050 sw .start ("lazyScheduler" );
51- context .destroy ();
51+ context .close ();
5252 sw .stop ();
5353 assertTrue ("Quartz Scheduler with lazy-init is hanging on destruction: " +
5454 sw .getTotalTimeMillis (), sw .getTotalTimeMillis () < 500 );
Original file line number Diff line number Diff line change 3434import org .springframework .beans .BeansException ;
3535import org .springframework .beans .CachedIntrospectionResults ;
3636import org .springframework .beans .factory .BeanFactory ;
37- import org .springframework .beans .factory .DisposableBean ;
3837import org .springframework .beans .factory .NoSuchBeanDefinitionException ;
3938import org .springframework .beans .factory .config .AutowireCapableBeanFactory ;
4039import org .springframework .beans .factory .config .BeanFactoryPostProcessor ;
124123 * @see org.springframework.context.MessageSource
125124 */
126125public abstract class AbstractApplicationContext extends DefaultResourceLoader
127- implements ConfigurableApplicationContext , DisposableBean {
126+ implements ConfigurableApplicationContext {
128127
129128 /**
130129 * Name of the MessageSource bean in the factory.
@@ -940,12 +939,13 @@ public void run() {
940939 }
941940
942941 /**
943- * DisposableBean callback for destruction of this instance.
942+ * Callback for destruction of this instance, originally attached
943+ * to a {@code DisposableBean} implementation (not anymore in 5.0).
944944 * <p>The {@link #close()} method is the native way to shut down
945945 * an ApplicationContext, which this method simply delegates to.
946- * @see #close()
946+ * @deprecated as of Spring Framework 5.0, in favor of {@link #close()}
947947 */
948- @ Override
948+ @ Deprecated
949949 public void destroy () {
950950 close ();
951951 }
You can’t perform that action at this time.
0 commit comments