|
1 | 1 | /*
|
2 |
| - * Copyright 2002-2011 the original author or authors. |
| 2 | + * Copyright 2002-2015 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.
|
|
17 | 17 | package org.springframework.context;
|
18 | 18 |
|
19 | 19 | /**
|
20 |
| - * An extension of the {@link Lifecycle} interface for those objects that require to be |
21 |
| - * started upon ApplicationContext refresh and/or shutdown in a particular order. |
| 20 | + * An extension of the {@link Lifecycle} interface for those objects that require to |
| 21 | + * be started upon ApplicationContext refresh and/or shutdown in a particular order. |
22 | 22 | * The {@link #isAutoStartup()} return value indicates whether this object should
|
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
|
|
55 | 55 | *
|
56 | 56 | * @author Mark Fisher
|
57 | 57 | * @since 3.0
|
| 58 | + * @see LifecycleProcessor |
| 59 | + * @see ConfigurableApplicationContext |
58 | 60 | */
|
59 | 61 | public interface SmartLifecycle extends Lifecycle, Phased {
|
60 | 62 |
|
61 | 63 | /**
|
62 |
| - * Return whether this Lifecycle component should be started automatically |
63 |
| - * by the container when the ApplicationContext is refreshed. A value of |
64 |
| - * "false" indicates that the component is intended to be started manually. |
| 64 | + * Returns {@code true} if this {@code Lifecycle} component should get |
| 65 | + * started automatically by the container at the time that the containing |
| 66 | + * {@link ApplicationContext} gets refreshed. |
| 67 | + * <p>A value of {@code false} indicates that the component is intended to |
| 68 | + * be started through an explicit {@link #start()} call instead, analogous |
| 69 | + * to a plain {@link Lifecycle} implementation. |
| 70 | + * @see #start() |
| 71 | + * @see #getPhase() |
| 72 | + * @see LifecycleProcessor#onRefresh() |
| 73 | + * @see ConfigurableApplicationContext#refresh() |
65 | 74 | */
|
66 | 75 | boolean isAutoStartup();
|
67 | 76 |
|
68 | 77 | /**
|
69 | 78 | * Indicates that a Lifecycle component must stop if it is currently running.
|
70 |
| - * <p>The provided callback is used by the {@link LifecycleProcessor} to support an |
71 |
| - * ordered, and potentially concurrent, shutdown of all components having a |
| 79 | + * <p>The provided callback is used by the {@link LifecycleProcessor} to support |
| 80 | + * an ordered, and potentially concurrent, shutdown of all components having a |
72 | 81 | * common shutdown order value. The callback <b>must</b> be executed after
|
73 |
| - * the SmartLifecycle component does indeed stop. |
74 |
| - * <p>The {@code LifecycleProcessor} will call <i>only</i> this variant of the |
| 82 | + * the {@code SmartLifecycle} component does indeed stop. |
| 83 | + * <p>The {@link LifecycleProcessor} will call <i>only</i> this variant of the |
75 | 84 | * {@code stop} method; i.e. {@link Lifecycle#stop()} will not be called for
|
76 |
| - * {@link SmartLifecycle} implementations unless explicitly delegated to within |
77 |
| - * this method. |
| 85 | + * {@code SmartLifecycle} implementations unless explicitly delegated to within |
| 86 | + * the implementation of this method. |
| 87 | + * @see #stop() |
| 88 | + * @see #getPhase() |
78 | 89 | */
|
79 | 90 | void stop(Runnable callback);
|
80 | 91 |
|
|
0 commit comments