|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2015 the original author or authors. |
| 2 | + * Copyright 2002-2018 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.
|
|
23 | 23 | * be started at the time of a context refresh. The callback-accepting
|
24 | 24 | * {@link #stop(Runnable)} method is useful for objects that have an asynchronous
|
25 | 25 | * shutdown process. Any implementation of this interface <i>must</i> invoke the
|
26 |
| - * callback's run() method upon shutdown completion to avoid unnecessary delays |
27 |
| - * in the overall ApplicationContext shutdown. |
| 26 | + * callback's {@code run()} method upon shutdown completion to avoid unnecessary |
| 27 | + * delays in the overall ApplicationContext shutdown. |
28 | 28 | *
|
29 | 29 | * <p>This interface extends {@link Phased}, and the {@link #getPhase()} method's
|
30 | 30 | * return value indicates the phase within which this Lifecycle component should
|
31 |
| - * be started and stopped. The startup process begins with the <i>lowest</i> |
32 |
| - * phase value and ends with the <i>highest</i> phase value (Integer.MIN_VALUE |
33 |
| - * is the lowest possible, and Integer.MAX_VALUE is the highest possible). The |
34 |
| - * shutdown process will apply the reverse order. Any components with the |
| 31 | + * be started and stopped. The startup process begins with the <i>lowest</i> phase |
| 32 | + * value and ends with the <i>highest</i> phase value ({@code Integer.MIN_VALUE} |
| 33 | + * is the lowest possible, and {@code Integer.MAX_VALUE} is the highest possible). |
| 34 | + * The shutdown process will apply the reverse order. Any components with the |
35 | 35 | * same value will be arbitrarily ordered within the same phase.
|
36 | 36 | *
|
37 |
| - * <p>Example: if component B depends on component A having already started, then |
38 |
| - * component A should have a lower phase value than component B. During the |
39 |
| - * shutdown process, component B would be stopped before component A. |
| 37 | + * <p>Example: if component B depends on component A having already started, |
| 38 | + * then component A should have a lower phase value than component B. During |
| 39 | + * the shutdown process, component B would be stopped before component A. |
40 | 40 | *
|
41 |
| - * <p>Any explicit "depends-on" relationship will take precedence over |
42 |
| - * the phase order such that the dependent bean always starts after its |
43 |
| - * dependency and always stops before its dependency. |
| 41 | + * <p>Any explicit "depends-on" relationship will take precedence over the phase |
| 42 | + * order such that the dependent bean always starts after its dependency and |
| 43 | + * always stops before its dependency. |
44 | 44 | *
|
45 |
| - * <p>Any Lifecycle components within the context that do not also implement |
46 |
| - * SmartLifecycle will be treated as if they have a phase value of 0. That |
47 |
| - * way a SmartLifecycle implementation may start before those Lifecycle |
48 |
| - * components if it has a negative phase value, or it may start after |
49 |
| - * those components if it has a positive phase value. |
| 45 | + * <p>Any {@code Lifecycle} components within the context that do not also |
| 46 | + * implement {@code SmartLifecycle} will be treated as if they have a phase |
| 47 | + * value of 0. That way a {@code SmartLifecycle} implementation may start |
| 48 | + * before those {@code Lifecycle} components if it has a negative phase value, |
| 49 | + * or it may start after those components if it has a positive phase value. |
50 | 50 | *
|
51 |
| - * <p>Note that, due to the auto-startup support in SmartLifecycle, |
52 |
| - * a SmartLifecycle bean instance will get initialized on startup of the |
53 |
| - * application context in any case. As a consequence, the bean definition |
54 |
| - * lazy-init flag has very limited actual effect on SmartLifecycle beans. |
| 51 | + * <p>Note that, due to the auto-startup support in {@code SmartLifecycle}, a |
| 52 | + * {@code SmartLifecycle} bean instance will usually get initialized on startup |
| 53 | + * of the application context in any case. As a consequence, the bean definition |
| 54 | + * lazy-init flag has very limited actual effect on {@code SmartLifecycle} beans. |
55 | 55 | *
|
56 | 56 | * @author Mark Fisher
|
57 | 57 | * @since 3.0
|
|
0 commit comments