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 1
1
/*
2
- * Copyright 2002-2009 the original author or authors.
2
+ * Copyright 2002-2017 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
30
30
*/
31
31
public class QuartzSchedulerLifecycleTests {
32
32
33
- @ Test // SPR-6354
33
+ @ Test // SPR-6354
34
34
public void destroyLazyInitSchedulerWithDefaultShutdownOrderDoesNotHang () {
35
35
AbstractApplicationContext context = new ClassPathXmlApplicationContext ("quartzSchedulerLifecycleTests.xml" , this .getClass ());
36
36
assertNotNull (context .getBean ("lazyInitSchedulerWithDefaultShutdownOrder" ));
37
37
StopWatch sw = new StopWatch ();
38
38
sw .start ("lazyScheduler" );
39
- context .destroy ();
39
+ context .close ();
40
40
sw .stop ();
41
41
assertTrue ("Quartz Scheduler with lazy-init is hanging on destruction: " +
42
42
sw .getTotalTimeMillis (), sw .getTotalTimeMillis () < 500 );
43
43
}
44
44
45
- @ Test // SPR-6354
45
+ @ Test // SPR-6354
46
46
public void destroyLazyInitSchedulerWithCustomShutdownOrderDoesNotHang () {
47
47
AbstractApplicationContext context = new ClassPathXmlApplicationContext ("quartzSchedulerLifecycleTests.xml" , this .getClass ());
48
48
assertNotNull (context .getBean ("lazyInitSchedulerWithCustomShutdownOrder" ));
49
49
StopWatch sw = new StopWatch ();
50
50
sw .start ("lazyScheduler" );
51
- context .destroy ();
51
+ context .close ();
52
52
sw .stop ();
53
53
assertTrue ("Quartz Scheduler with lazy-init is hanging on destruction: " +
54
54
sw .getTotalTimeMillis (), sw .getTotalTimeMillis () < 500 );
Original file line number Diff line number Diff line change 34
34
import org .springframework .beans .BeansException ;
35
35
import org .springframework .beans .CachedIntrospectionResults ;
36
36
import org .springframework .beans .factory .BeanFactory ;
37
- import org .springframework .beans .factory .DisposableBean ;
38
37
import org .springframework .beans .factory .NoSuchBeanDefinitionException ;
39
38
import org .springframework .beans .factory .config .AutowireCapableBeanFactory ;
40
39
import org .springframework .beans .factory .config .BeanFactoryPostProcessor ;
124
123
* @see org.springframework.context.MessageSource
125
124
*/
126
125
public abstract class AbstractApplicationContext extends DefaultResourceLoader
127
- implements ConfigurableApplicationContext , DisposableBean {
126
+ implements ConfigurableApplicationContext {
128
127
129
128
/**
130
129
* Name of the MessageSource bean in the factory.
@@ -940,12 +939,13 @@ public void run() {
940
939
}
941
940
942
941
/**
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).
944
944
* <p>The {@link #close()} method is the native way to shut down
945
945
* an ApplicationContext, which this method simply delegates to.
946
- * @see #close()
946
+ * @deprecated as of Spring Framework 5.0, in favor of {@link #close()}
947
947
*/
948
- @ Override
948
+ @ Deprecated
949
949
public void destroy () {
950
950
close ();
951
951
}
You can’t perform that action at this time.
0 commit comments